@@ -826,7 +826,7 @@ class Ponysay():
         for (opt, ponies, quotes) in [('-f', standard, False), ('+f', extra, False), ('-F', both, False), ('-q', standard, True)]:
             if args.opts[opt] is not None:
                 for pony in args.opts[opt]:
-                    selection.append((opt, ponies, quotes))
+                    selection.append((pony, ponies, quotes))
         ## TODO +q -Q
         (pony, quote) = self.__getPony(selection, args)


@@ -140,7 +140,7 @@ def linklist(ponydirs = None, quoters = [], ucsiser = None):

     for ponydir in ponydirs: # Loop ponydirs
         ## Get all pony files in the directory
-        ponies = _get_file_list(ponydirs, '.pony')
+        ponies = _get_file_list(ponydir, '.pony')

         ## If there are no ponies in the directory skip to next directory, otherwise, print the directories name
         if len(ponies) == 0:


@@ -19,7 +19,7 @@ class Button(InteractableUIElement):
         else:
             self.size = size

-        super().__init__(self.size, self.__idle, self.__hover, self.__click, position, on_click, on_hover, on_leave)
+        super().__init__(position, self.__idle, self.__hover, self.__click, self.size, on_click, on_hover, on_leave)

         self.id = Iders.btnIdler.add(self)


@@ -93,7 +93,7 @@ def calc_pka(file_data, kbt, coord_ts):
                 logger.info("Found local max '%f' at coordinate '%f'", cur_corr, cur_coord)
                 return -math.log10(inv_C_0 / sum_for_pka), cur_corr, cur_coord
         else:
-            if cur_corr >= coord_ts:
+            if cur_coord >= coord_ts:
                 logger.info("Integrating to input TS coordinate '%f' with value , '%f'", cur_coord, cur_corr)
                 return -math.log10(inv_C_0 / sum_for_pka), cur_corr, cur_coord


@@ -34,7 +34,7 @@ class UserFactory(object):
         copy_field('email', True)
         copy_field('first_name')
         copy_field('last_name')
-        if access_token is None:
+        if access_token is not None:
             user.access_token = access_token

         user.save()

ReplaceText(target=' is not ' @(37,23)->(37,27))


@@ -254,5 +254,5 @@ def debug_all_tokens_for_user(user_id):
             logger.info('Deleting user tokens except best one.')
             tokens_to_delete = sorted(processed_user_tokens)
             tokens_to_delete.remove(best_token.id)
-            for token_id in processed_user_tokens:
+            for token_id in tokens_to_delete:
                 UserToken.objects.filter(id=token_id).update(deleted=True)


@@ -620,7 +620,7 @@ def nsAliveTest(theZone):         # query all authoritative NS for SOA of zone
     nameservers = misc.authNS(theZone)
     for nameserver in nameservers[:]:
         try:
-            l.logDebug('Querying {} for SOA of {} via TCP'.format(theZone, nameserver))
+            l.logDebug('Querying {} for SOA of {} via TCP'.format(nameserver, theZone))
             response = dns.query.tcp(request, nameserver, 10)
             rcode = response.rcode()
             if rcode == 0: continue


@@ -61,7 +61,7 @@ class IconBundler:
                 return os.path.join(root, svg_icon_name)

             if png_icon_name in files:
-                new_path = os.path.join(root, svg_icon_name)
+                new_path = os.path.join(root, png_icon_name)
                 new_size = self._extract_icon_size_from_path(new_path)

                 if new_size > size:


@@ -58,7 +58,7 @@ class DataLoader():
             for filePattern in file:
                 files += matchPattern(filePattern)
         elif isinstance(file, str):
-            files = matchPattern(filePattern)
+            files = matchPattern(file)
         else:
             raise RuntimeError("natlang.dataLoader.load [ERROR]: parameter " +
                                "type")


@@ -123,7 +123,7 @@ class Registry(object):
       options = resource.versions()
       version = self.matchOne(target, options)

-    if resource is None:
+    if version is None:
       message = ("Couldn't match version '{v}' to '{id}'; options: {vers}"
                  .format(v=target, id=resource.id, vers=", ".join(options)))


@@ -22,7 +22,7 @@ def example_simple_rpc():
     write_stream = capnp.FdAsyncIoStream(write.fileno())

     restorer = capnp.Restorer(capability.TestSturdyRefObjectId, _restore)
-    server = capnp.RpcServer(loop, restorer, write_stream)
+    server = capnp.RpcServer(loop, write_stream, restorer)
     client = capnp.RpcClient(loop, read_stream)

     ref = capability.TestSturdyRefObjectId.new_message()


@@ -55,7 +55,7 @@ class Sass(object):

         rebuild = current_app.config.get('SASS_REBUILD', False)

-        if rebuild:
+        if not rebuild:
             if not hasattr(stack.top, 'sass_cache'):
                 stack.top.sass_cache = {}
             cache = stack.top.sass_cache


@@ -45,7 +45,7 @@ def create_upload_data(content_type, source_filename, upload_to):
     bucket_url = "https://%s/%s" % (endpoint, bucket)

     return {
-        "policy": policy,
+        "policy": encoded,
         "signature": signature_b64,
         "key": key,
         "AWSAccessKeyId": access_key,


@@ -53,7 +53,7 @@ def clFFT_ExecuteInterleaved(plan, batchSize, dir, data_in, data_out):
 			currWrite = 1 if numKernelsOdd else 2

 		for kInfo in kernelInfo:
-			if isInPlace and numKernelsOdd and not inPlaceDone and kernelInfo.in_place_possible:
+			if isInPlace and numKernelsOdd and not inPlaceDone and kInfo.in_place_possible:
 				currWrite = currRead
 				inPlaceDone = True


@@ -12,7 +12,7 @@ def get_method():
     get_method=input("Please Enter Method , Shutdown[1] , Hibernate[2] , Restart[3]")
     if get_method=="2":
         flag="-h"
-    elif flag=="3":
+    elif get_method=="3":
         flag="-r"
     else:
         flag="-s"


@@ -89,7 +89,7 @@ def create(frontend_cls='os_m3_engine.ootb.StdinFrontend',
     default_engine_transport_config = ENGINE_TRANSPORT_BRIDGE_CONFIG \
         if backend_cls is not None else ENGINE_TRANSPORT_CONFIG

-    e_transport_config = engine_backend_config
+    e_transport_config = engine_transport_config
     if engine_transport_config in (ENGINE_TRANSPORT_CONFIG, ENGINE_TRANSPORT_BRIDGE_CONFIG):
         e_transport_config = None


@@ -143,7 +143,7 @@ def query_ncbi_species(species_entry):
             if result is not None:
                 return result["ncbi_species"]
             elif group_result is not None:
-                return result["ncbi_species"]
+                return group_result["ncbi_species"]
             else:
                 return None
     except Exception as e:


@@ -268,7 +268,7 @@ def update_run_report(run, n_intervals):
 )
 def update_rerun_form(run_name):
     run_name = run_name.split("/")[0]
-    if run_name == "" or hasattr(keys, "rerun"):
+    if run_name == "" or not hasattr(keys, "rerun"):
         return None

     run_data = import_data.get_run(run_name)


@@ -190,7 +190,7 @@ class AddressSpace_description_TestCase(unittest.TestCase):
         description_str = "address 0 for ipv4"
         self.address_space.describe(
             description=description_str,
-            ip_parameter=network,
+            ip_parameter=zero_ipv4,
         )
         self.assertEqual(
             self.address_space.description(


@@ -263,7 +263,7 @@ class AddressSpace:
                 self.__parent_supernet[child] = as_network
                 children_of_as_network.add(child)
                 children_of_supernet.remove(child)
-            children_of_supernet.add(as_address)
+            children_of_supernet.add(as_network)
         else:
             raise TypeError("ip_parameter must be a valid IP parameter")


@@ -289,7 +289,7 @@ class AddressSpace:
             self.__description[as_network] = description
             described = True

-            self.__parent_supernet[as_address] = supernet
+            self.__parent_supernet[as_network] = supernet
             children_of_as_network = (
                 self.__children_ip_object.setdefault(as_network, set())
             )


@@ -23,7 +23,7 @@ def jerror_handler(e):
     """http://jsonapi.org/format/#errors
     """

-    if not hasattr('name', e):
+    if not hasattr(e, 'name'):
         raise InternalServerError(e.description)

     app.logger.error(e.description)


@@ -139,7 +139,7 @@ class RTable(object):
                     self._table_elements['body'].append(new_row)
             html_foot = getattr(obj, 'tfoot')
             if html_foot:
-                for a_foot in html_body.find_all('td'):
+                for a_foot in html_foot.find_all('td'):
                     foot_cell = {
                         'value': a_foot.get_text(strip=True),
                     }


@@ -324,7 +324,7 @@ class FastCNER:
                 self.logger.debug(
                     'try add matched rule ({}-{})\t{}'.format(match_begin, match_end, str(self.rule_store[rule_id])))
             current_span.rule_id = rule_id
-            if key in matches:
+            if key in overlap_checkers:
                 current_spans_list = matches[key]
                 overlap_checker = overlap_checkers[key]
                 overlapped_pos = overlap_checker.search(current_span.begin, current_span.end)


@@ -142,7 +142,7 @@ class FeatureServerProxyFactory(object):

     def isCreate(self):
         data_id = self.featureServerProxy.getID()
-        return data_id is not None and self.request.body != "" and self.request.method == "POST"
+        return data_id is None and self.request.body != "" and self.request.method == "POST"

     def isUpdate(self):
         data_id = self.featureServerProxy.getID()


@@ -59,7 +59,7 @@ def setup_logging(handler, exclude=['raven', 'sentry.errors']):
     Returns a boolean based on if logging was configured or not.
     """
     logger = logging.getLogger()
-    if handler.__class__ not in map(type, logger.handlers):
+    if handler.__class__ in map(type, logger.handlers):
         return False

     logger.addHandler(handler)


@@ -39,7 +39,7 @@ class Scrape(BrowserView):
         parts = url.split('//', 1)
         this_base_url = parts[0]+'//'+parts[1].split('/', 1)[0]

-        if url not in scrape_whitelist:
+        if this_base_url not in scrape_whitelist:
             return "URL domain is not in whitelist"

         #get html from the requested url


@@ -18,7 +18,7 @@ import os
 import sphinx_rtd_theme

 # We cannot install llvmlite on READTHEDOCS
-if os.environ.get('READTHEDOCS') != 'True':
+if os.environ.get('READTHEDOCS') == 'True':
     from unittest.mock import MagicMock
     class MockModule(MagicMock):
         @classmethod


@@ -169,6 +169,6 @@ class WeatherVaneInterface(object):
         bits = self.spi.read_pin(self.station_bits)
         result = 0
         for index, value in enumerate(bits):
-            result = value * 2**index
+            result += value * 2**index

         return self.STATIONS[result]
\ No newline at end of file


@@ -49,7 +49,7 @@ def closure(data, k=1.0):
     out = np.copy(data)
     for i in range(data.shape[1]):
         out[:, i] = np.divide(out[:, i], data_sum)
-    out = data * k
+    out = out * k
     return out


@@ -88,7 +88,7 @@ class XNATSource(ArchiveSource, XNATMixin):
              proj_summ_sess_name) = XNATArchive.project_summary_name(
                 project.id)
             try:
-                proc_session = xnat_login.experiments[
+                proc_session = subject.experiments[
                     self.session_id + XNATArchive.PROCESSED_SUFFIX]
                 proc_datasets = dict(
                     (s.type, s) for s in proc_session.scans.itervalues())


@@ -417,7 +417,7 @@ class TestProjectInfo(BaseMultiSubjectTestCase):
                         proj_dir, subject.id, SUMMARY_NAME,
                         dataset.filename)
                 for session in subject.sessions:
-                    for dataset in subject.datasets:
+                    for dataset in session.datasets:
                         dataset.path = os.path.join(
                             proj_dir, session.subject_id,
                             session.visit_id, dataset.filename)


@@ -268,7 +268,7 @@ class BaseArchiveSink(BaseArchiveNode):
                             PATH_TRAIT)
         # Add input fields
         for field in fields:
-            assert isinstance(dataset, FieldSpec)
+            assert isinstance(field, FieldSpec)
             self._add_trait(self.inputs, field.name + FIELD_SUFFIX,
                             field.dtype)


@@ -353,7 +353,7 @@ class LocalArchive(Archive):
                     Dataset.from_path(
                         os.path.join(session_path, dname),
                         multiplicity=multiplicity))
-            if FIELDS_FNAME in dname:
+            if FIELDS_FNAME in dnames:
                 fields = self.fields_from_json(os.path.join(
                     session_path, FIELDS_FNAME),
                     multiplicity=multiplicity)


@@ -424,7 +424,7 @@ class Study(object):
                 "is not a valid option ('{}')".format(
                     "', '".join(unrecognised_values), name,
                     self._param_error_location,
-                    "', '".join(switch.choices)))
+                    "', '".join(spec.choices)))
         if self._referenced_switches is not None:
             self._referenced_switches.add(name)
         return switch.value in values


@@ -214,7 +214,7 @@ class Study(object):
                                     "to\n{}.".format(e, bound_inpt, spec))
                                 raise e
                         else:
-                            if inpt.format not in spec.valid_formats:
+                            if bound_inpt.format not in spec.valid_formats:
                                 raise ArcanaUsageError(
                                     "Cannot pass {} as an input to {} as it is"
                                     " not in one of the valid formats ('{}')"


@@ -116,7 +116,7 @@ class ModulesEnvironment(BaseEnvironment):
                                    .format(req.name, local_name))
             avail_versions = []
             for local_ver_name in version_names:
-                ver_name = self.map_version(req_range, local_ver_name)
+                ver_name = self.map_version(req, local_ver_name)
                 try:
                     avail_versions.append(
                         req.v(ver_name, local_name=local_name,


@@ -683,7 +683,7 @@ class Study(object):
             in_branch = switch.value in values
             if not in_branch:
                 try:
-                    in_branch = switch.fallbacks[switch.value] in values
+                    in_branch = spec.fallbacks[switch.value] in values
                 except KeyError:
                     pass
         return in_branch


@@ -39,7 +39,7 @@ def _generateWideform(longform_df, rx=None):
     for entry in rowmeta_columns:
         rowmeta_dict[entry] = longform_df[entry]

-    if (rx is None):
+    if (rx is not None):
         ptid_md = pd.DataFrame(data=rowmeta_dict,
                            columns=rowmeta_dict.keys())
         ptid_md = ptid_md.drop_duplicates()

ReplaceText(target=' is not ' @(42,10)->(42,14))


@@ -22,7 +22,7 @@ class BinMix(Node):
       self.blockbuf.copybuf(self.tone(self.block))
       if not noiseflag:
         self.blockbuf.orbuf(self.noise(self.block))
-    elif noiseflag:
+    elif not noiseflag:
       self.blockbuf.copybuf(self.noise(self.block))
     else:
       self.blockbuf.fill(0)


@@ -61,7 +61,7 @@ def cjsx(filename, data):

     command = "%s -c -s" % (executable or 'cjsx')
     if bare:
-        command = ' '.join((executable, '-b'))
+        command = ' '.join((command, '-b'))

     return runner(command, filename, data, '.js')


@@ -92,7 +92,7 @@ def main():
             print('Similar domains to {}'.format(dom))
             domains.difference_update(set(dom))
             for d in domains:
-                print_diff(d, args.domain)
+                print_diff(args.domain, d)
                 if write:
                     f.write(d + "\n")
             if (args.check):


@@ -882,7 +882,7 @@ def get_xml_object(xml_text):
                 nominas.append(nomina_object)

-            if nomina_object:
+            if nominas:
                 xml.complemento.nominas = nominas
                 xml.complemento.nomina =  nominas[0]
             else:


@@ -378,7 +378,7 @@ class AddonUpdater():
         remote_buildfile = self.get_file_obj(buildfile)
         buildfile_content = self.get_file_content(remote_buildfile)

-        used_file = remote_dockerfile.split('BUILD_FROM=hassioaddons/')[1]
+        used_file = dockerfile_content.split('BUILD_FROM=hassioaddons/')[1]
         used_file = used_file.split('\n')[0]

         base = used_file.split(':')[1]


@@ -161,7 +161,7 @@ class DeviceImporter(ContextDecorator):
                     self._search_key_case_insensitive(interfaces, lag)
                 )
             except KeyError:
-                logger.error("%s not exist in polled interfaces", ifname)
+                logger.error("%s not exist in polled interfaces", lag)
                 continue

             interfaces[ifname]["lag"] = real_lag_name


@@ -96,7 +96,7 @@ class ProcessInlineFormsetView(ProcessFormView):
             obj = form.save(commit=False)
             inline_formset = self.get_inline_formset()
             if inline_formset.is_valid():
-                form.save()
+                obj.save()
                 inline_formset.save()
                 return self.form_valid(form, inline_formset)
         return self.form_invalid(form=form, inline_formset=inline_formset)


@@ -6010,7 +6010,7 @@ class Mesh(object):
                 else:
                     quality_func = lambda mesh: mesh.Lengths()
             elif quality_assessor == "aspect_ratio":
-                quality_assessor = lambda mesh: mesh.AspectRatios()
+                quality_func = lambda mesh: mesh.AspectRatios()
             elif quality_assessor == "angle":
                 quality_func = lambda mesh: mesh.Angles()
             else:


@@ -81,7 +81,7 @@ class FactorizationRecommender(BaseDFSparseRecommender):
             all_metrics.plot()
         self.early_stop_metrics_df = all_metrics

-        self._set_epochs(epochs=epochs_max)
+        self._set_epochs(epochs=max_epoch)
         if not refit_on_all:
             simple_logger.info('Loading best model from checkpoint at %d epochs' % max_epoch)
             self.model, self.model_checkpoint = self.model_checkpoint, None


@@ -25,7 +25,7 @@ class Filesystem(object):
         if head and not os.path.exists(head):
             cls.mkdir(head)

-        if os.path.exists(path):        # handles case of trailing /
+        if not os.path.exists(path):        # handles case of trailing /
             os.mkdir(path)


@@ -81,7 +81,7 @@ class ExegeteRenderingTRhRow(JSONable):

     @classmethod
     def construct(cls, gas, rh, t_min, t_max, t_delta, exegete: Exegete):
-        cells = [ExegeteRenderingTRhCell(t, exegete.error(gas, t, rh))
+        cells = [ExegeteRenderingTRhCell(t, exegete.error(gas, rh, t))
                  for t in range(t_min, t_max + 1, t_delta)]

         return ExegeteRenderingTRhRow(rh, cells)


@@ -43,7 +43,7 @@ print("-")

 for rh in range(10, 91, 5):
     for t in range(0, 46, 5):
-        interpretation = exegete.interpretation('NO2', text, t, rh)
+        interpretation = exegete.interpretation('NO2', text, rh, t)
         print("rh: %2d t: %2d text: %3.1f interpretation: %3.1f" % (rh, t, text, interpretation))

     print("-")


@@ -68,7 +68,7 @@ class S3Manager(object):
             bucket_list.append(str(inters), bucket["Name"])
             inters += 1

-        return bucket_list
+        return response

     def retrieve_from_bucket(self, bucket_name, resource_name):


@@ -59,7 +59,7 @@ class AccessKey(PersistentJSONable):

     @classmethod
     def persistence_location(cls, host):
-        return host.aws_dir(), cls.__FILENAME
+        return cls.aws_dir(), cls.__FILENAME

     @classmethod


@@ -53,7 +53,7 @@ class DeviceTester(object):
             delta = now - latest_pub
             elapsed_minutes = delta.total_seconds() / 60

-            return elapsed_minutes > self.__config.unresponsive_minutes_allowed
+            return elapsed_minutes < self.__config.unresponsive_minutes_allowed

     def has_status_changed(self, s3_device_status_list):


@@ -8,7 +8,7 @@ def is_older_than(file1, file2):
     return os.path.getmtime(file1) < os.path.getmtime(file2)

 # Generate README.rst if missing or out of date
-if not os.path.exists('README.rst') and is_older_than('README.rst', 'README.md'):
+if not os.path.exists('README.rst') or is_older_than('README.rst', 'README.md'):
     os.system('pandoc --from=markdown --to=rst --output=README.rst README.md')
 with open('README.rst') as file:
     long_description = file.read()


@@ -26,7 +26,7 @@ class Command(ScriptCommand):
         iterators = []
         for path in paths:
             try:
-                iterators.append(IterableTrackPaths(self.script.configuration, path))
+                iterators.append(IterableTrackPaths(path, self.script.configuration))
             except LibraryError as e:
                 self.error(e)
         return iterators


@@ -141,7 +141,7 @@ class BaseContextMetaClass(type):
                                 and "uint8_t" in docstring.split()
                             ):
                                 return_value.append(
-                                    to_bytearray(value.value, args[i + 1].value)
+                                    to_bytearray(args[i + 1].value, value.value)
                                 )
                                 skip = True
                                 continue


@@ -1089,7 +1089,7 @@ def pairedcontrast(data, x, y, idcol, hue = None,
                     linestyle = 'dotted')

     # Set xlimit to appropriate limits..
-    newxlim = (ax_left.get_xlim()[0], xpos + 0.25)
+    newxlim = (ax_left.get_xlim()[0], xposPlusViolin + 0.25)
     ax_left.set_xlim(newxlim)

     # Remove left axes x-axis title.


@@ -88,7 +88,7 @@ def plotbootstrap_hubspoke(bslist, ax, violinWidth, violinOffset,
     for i in range(0, len(bslist)):
         bsi=bslist[i]
         # array=list(bsi.items())[7][1] # Pull out the bootstrapped array.
-        array=bslist['diffarray']
+        array=bsi['diffarray']
         ylims.append(array)

         # Then plot as violinplot.


@@ -106,7 +106,7 @@ class SpotifyAPI(object):
                 # Update ETag if song's playback was manipulated
                 if song["progress_ms"] < self.current_song["progress"] or song["progress_ms"] - 10000 > self.current_song["progress"]:
                     self.current_song_json_updated = str(time())
-                    LISTEN_ALONG_API.set_current_playing_song(song_uri=song["uri"], position_ms=song["progress_ms"])
+                    LISTEN_ALONG_API.set_current_playing_song(song_uri=item["uri"], position_ms=song["progress_ms"])

                 self.current_song["progress"] = song["progress_ms"]
                 self.current_song_json = json.dumps(self.current_song)


@@ -32,7 +32,7 @@ async def get_listen_along_users_endpoint(request: StarletteRequest) -> PlainTex
     for user in ListenAlong.users:
         users_json += user.public_json + ","

-    users_json = ']'
+    users_json += ']'
     return PlainTextResponse(content=users_json, media_type="application/json")

 @SERVER.route('/get_current_song', methods=['GET'])


@@ -21,7 +21,7 @@ class ListenAlong():
     @staticmethod
     def _set_song(user: ListenAlongUser, song_json: str) -> None:
         if user.tokens:
-            status = SpotifyWebAPI.set_current_playing_song(song_json, user.tokens.access)
+            status = SpotifyWebAPI.set_current_playing_song(user.tokens.access, song_json)
             if user.public.status != status:
                 user.public.status = status
                 user.public_json = json.dumps(asdict(user.public))


@@ -18,7 +18,7 @@ def run_command(input_command, env=None, cwd=None):
     if platform.system() == 'Windows':
         command = input_command.replace('\'', '"')
     else:
-        command = command.replace('"', '\'')
+        command = input_command.replace('"', '\'')

     # change cwd - Popen cwd input simply doesn't work.
     cur_dir = os.getcwd()


@@ -11,7 +11,7 @@ class post_install(install):
         install.run(self)
         print("*** Executing post install actions:")
         # update mpd configuration if necessary
-        if '/tmp/mpd.fifo' in open('/etc/mpd.conf').read():
+        if '/tmp/mpd.fifo' not in open('/etc/mpd.conf').read():
             os.system("sudo cat /etc/fifo-mpd.conf >> /etc/mpd.conf")
             os.system("sudo service mpd restart")
         # update music display init script

ReplaceText(target=' not in ' @(14,26)->(14,30))


@@ -43,7 +43,7 @@ def echo_copyright():
     cur_year = str(datetime.now().year)
     year_range = '2018'
     if cur_year != year_range:
-        year_range = '2018-{}'.format(year_range)
+        year_range = '2018-{}'.format(cur_year)
     gpl3_notice_2018 = [
         '{app_name} {version}'.format(
             app_name=__BigName__,


@@ -594,7 +594,7 @@ class IOS(TerminalCommands, CommandGetMethods):
                     )
                     #mac_table_list.append(line.split())

-            if len(line.split()) >= 1:
+            if len(line.split()) > 1:
                 if '--' in line.split()[0]:
                     flag = 1


@@ -20,7 +20,7 @@ class Parser(object):
                 output.extend(parsed)
             else:
                 output.append(parsed)
-        return parsed
+        return output

 class FileParser(Parser):


@@ -249,7 +249,7 @@ class Parser(object):
     ) -> pd.Series:
         try:
             apply_to = apply_to or apply_on
-            self.df[apply_on] = self.df[apply_on].apply(func)
+            self.df[apply_to] = self.df[apply_on].apply(func)
         except KeyError as ke:
             logger.debug(
                 MSG_PARSER_CHECK.format(op_name=self.operator.name, col_name=apply_on)


@@ -304,9 +304,9 @@ def calculateTWC(tile, patch_size = 'auto', output = False, show = False):

         # Extract the data
         WC = woody_cover[ymin:ymax, xmin:xmax]
-
+
         #  If at least 50 % of data is present...
-        if TWC.mask.sum() <= ((patch_size ** 2) * 0.5):
+        if WC.mask.sum() <= ((patch_size ** 2) * 0.5):

             # Calculate proportion of woody cover in patch
             TWC.data[n, m] = int(round((float(WC.sum()) / ((patch_size ** 2) - WC.mask.sum())) * 100))


@@ -106,7 +106,7 @@ def main():
     DEBUG, WAIT, NO_REFRESH, PATHS = not args.quite, args.wait, args.noRefresh, args.paths

     for PATH in PATHS:
-        if not os.path.isfile(PATHS):
+        if not os.path.isfile(PATH):
             print(f"`{PATH}` dosyaya ait değil.")
             continue


@@ -48,7 +48,7 @@ class RFID(object):
         self.spi.max_speed_hz = speed

         GPIO.setmode(pin_mode)
-        if pin_rst is None:
+        if pin_rst is not None:
             GPIO.setup(pin_rst, GPIO.OUT)
             GPIO.output(pin_rst, 1)
         GPIO.setup(pin_irq, GPIO.IN, pull_up_down=GPIO.PUD_UP)

ReplaceText(target=' is not ' @(51,18)->(51,22))


@@ -63,7 +63,7 @@ def run_optimization(problem_name: str, instance_class, solution_class, default_
     :param iter_cb: optional callback function that is called each iteration by some of the algorithms
     :param seed: optional seed value for the random number generators; 0: random initialization
     """
-    if embedded:
+    if not embedded:
         add_general_arguments_and_parse_settings(default_inst_file, seed)

     init_logger()


@@ -140,7 +140,7 @@ def _fetch_weather_json(
                 if (with_forecast):
                     forecast_url = forecast_urls[provider]
                     r = requests.get(
-                        forecast_url.format(location, units, api_key))
+                        forecast_url.format(loc_parsed, units, api_key))
                     f = json.loads(r.text)
                     if (c['response']['features']['forecast'] != 1):
                         return {'e': 'Unable to load forecast'}


@@ -227,7 +227,7 @@ class Pipeline(object):

             logger2.info(step.name)
             args = step.args.replace(
-                'patientname', tmpdir + patientname).replace('reference', ref).replace('samplename', samplename)
+                'patientname', tmpdir + patientname).replace('reference', ref).replace('samplename', patientname)
             cmdver = step.version.replace('.', '_')
             javacmds = ['GATK', 'picard', 'SnpSift', 'snpEff']
             if any(javacmd in step.command for javacmd in javacmds):


@@ -99,7 +99,7 @@ def download_corpora(corpus_indices=None,
             else:
                 url = CORPORA_SOURCES[index]["properties"]["url"]
                 filename = download_corpus(url, f"{folder_name}.zip")
-                folder_list.append(uncompress_corpus(filename, output_folder))
+                folder_list.append(uncompress_corpus(filename, folder_path))
     else:
         logging.error("No corpus selected. Nothing will be downloaded")
     return folder_list


@@ -122,7 +122,7 @@ class OraclePool(object):
             result_db = cursor.execute(sql, param)
             if commit:
                 conn.commit()
-                result = result_db.rowcount
+                result = cursor.rowcount
             else:
                 result = result_db.fetchall()
         except Exception as e:


@@ -137,7 +137,7 @@ def dict_flatten(dict_in: dict):
         else:
             dict_out[k] = dict_in[k]

-    return dict_in
+    return dict_out

 def main(x: dict, num_samples: int):


@@ -173,7 +173,7 @@ class ModelManagerController:
         try:
             Logger.log('L-0021')
             custom_model = self.__initialize_custom_model()
-            new_model = Model(model_id, model_name, description, author, model_name, analyzer_rule_set)
+            new_model = Model(model_id, model_name, description, author, model_id, analyzer_rule_set)
             new_model.set_reference(custom_model)
             Logger.log('L-0022')
             self.__apply_tokenizer_exceptions(new_model, tokenizer_exceptions_path)


@@ -104,7 +104,7 @@ class Model:
         token_analyzer = Analyzer(self.__analyzer_rules_set)
         for sent in doc.sents:
             for token in sent:
-                generated_token = Token(token.lemma_, token.is_oov, token.pos_, token.sent, token.sentiment, token.tag_, sent.text)
+                generated_token = Token(token.lemma_, token.is_oov, token.pos_, token.sent, token.sentiment, token.tag_, token.text)
                 token_analyzer.analyze_token(generated_token)
                 if not only_positives or generated_token.is_positive():
                     results.append(generated_token)


@@ -602,7 +602,7 @@ def plot_series(df: pd.DataFrame, column: str, groupby: str = '1S',
                       .mean()
                       .resample(groupby)
                       .apply(sem)
-                      if groupby == 'S' and groupby != '1S' else
+                      if groupby != 'S' and groupby != '1S' else
                       df[column].groupby('datetime').apply(sem))

             ax.fill_between(x, df_plot - df_sem, df_plot + df_sem,


@@ -401,7 +401,7 @@ class Client(object):
         _params = {'access_token': self.access_token}
         if params:
             _params.update(params)
-        response = requests.request(method, self.BASE_URL + endpoint, params=params, **kwargs)
+        response = requests.request(method, self.BASE_URL + endpoint, params=_params, **kwargs)
         return self._parse(response)

     def _parse(self, response):


@@ -270,7 +270,7 @@ def RemoveIllegals(line):
     """
     illegal = ['"', '', '(', ')']

-    linelist = [element for element in line if element in illegal]
+    linelist = [element for element in line if element not in illegal]
     line = _np.array(linelist)
     return line


@@ -480,7 +480,7 @@ class LSSTSpawner(namespacedkubespawner.NamespacedKubeSpawner):
         for vol in vollist:
             volname = self._get_volume_name_for_mountpoint(vol["mountpoint"])
             shortname = vol["mountpoint"][1:].replace("/", "-")
-            if volname in already_vols:
+            if shortname in already_vols:
                 self.log.info(
                     "Volume '{}' already exists for pod.".format(volname))
                 continue


@@ -68,7 +68,7 @@ class Task(TaskModel):
     def __init__(self, job, frame, parent_task=None, state=None,
                  priority=None, attempts=None, agent=None):
         # build parent job id
-        if not modelfor(job, TABLE_JOB):
+        if modelfor(job, TABLE_JOB):
             jobid = job.jobid
             if jobid is None:
                 raise ValueError("`job` with null id provided")


@@ -116,5 +116,5 @@ class Task(TaskModel):
         if priority is not None:
             self.priority = priority

-        if attempts is None:
+        if attempts is not None:
             self.attempts = attempts


@@ -85,7 +85,7 @@ class Granule(object):
             m = re.match(self.inputs[f], os.path.basename(filename))
             if m is not None:
                 # does the file exist locally
-                if os.path.exists(f):
+                if os.path.exists(filename):
                     self.local_in[f] = filename
                 else:
                     self.remote_in[f] = filename


@@ -14,7 +14,7 @@ class Enum(Node):
             args = self.const[name]
             names = [codegen.getName() for _ in args]
             codegen.inFunction()
-            if len(args) > 0:
+            if len(names) > 0:
                 codegen.append("function "+self.package+"_"+name+"(")
                 codegen.append(",".join(names))
                 codegen.append("){return ["+str(count)+","+",".join(names)+"]}")


@@ -171,7 +171,7 @@ class QueryBuilder(object):

             if tag in filters:

-                filters.append(query.c.key == tag.lower())
+                filters_list.append(query.c.key == tag.lower())

                 if settings['filterable'] == 'like':
                     filters_list.append(query.c.value.like('%' + filters[tag].lower() + '%'))


@@ -366,7 +366,7 @@ class Tokenizer(object):
             f = open(f, 'rb')
         for lineno, ln in enumerate(f, 1):
             line = ln.strip()
-            if not isinstance(f, text_type):
+            if not isinstance(line, text_type):
                 try:
                     line = line.decode('utf-8').lstrip('\ufeff')
                 except UnicodeDecodeError:


@@ -103,7 +103,7 @@ def process(
     # EG https://treeherder.mozilla.org/perf.html#/graphs?highlightAlerts=1&series=mozilla-central,fee739b45f7960e4a520d8e0bd781dd9d0a3bec4,1,10&timerange=31536000
     url = "https://treeherder.mozilla.org/perf.html#/graphs?" + value2url_param({
         "highlightAlerts": 1,
-        "series": [sig.repository, sig.id, 1, coalesce(sig.framework, sig.framework_id)],
+        "series": [sig.repository, sig.id, 1, coalesce(sig.framework_id, sig.framework)],
         "timerange": 31536000,
     })


@@ -93,7 +93,7 @@ class MapLayer(object):
                 raise Exception(datasetPath +" doesn't exist")
             #test for schema lock, before continue
             trys=0
-            while arcpy.TestSchemaLock(datasetPath) or trys>6:
+            while arcpy.TestSchemaLock(datasetPath) or trys<6:
                 time.sleep(10)
                 trys+=1
             #next


@@ -31,7 +31,7 @@ def pad_right(string, chars, filler="0"):

 def is_prefixed(value, prefix):
     return value.startswith(
-        force_bytes(prefix) if is_bytes(prefix) else force_text(prefix)
+        force_bytes(prefix) if is_bytes(value) else force_text(prefix)
     )


@@ -143,7 +143,7 @@ def outputBlockFormatter(block):

     if is_array(block.get("transactions")):
         for item in block["transactions"]:
-            if is_string(item):
+            if not is_string(item):
                 item = outputTransactionFormatter(item)

     return block


@@ -611,7 +611,7 @@ def call_contract_function(contract=None,
     if transaction is None:
         call_transaction = {}
     else:
-        call_transaction = dict(**call_transaction)
+        call_transaction = dict(**transaction)

     if not arguments:
         arguments = []


@@ -131,7 +131,7 @@ class Signal:
         with self._slots_lock:
             for slot in self.slots:
                 if slot.function is function:
-                    ret.append(function)
+                    ret.append(slot)

         if ret:
             return ret


@@ -22,7 +22,7 @@ def login(request):
     else:
         errors = {}
     response = HttpResponse()
-    response.session.set_test_cookie()
+    request.session.set_test_cookie()
     t = template_loader.get_template('registration/login')
     c = Context(request, {
         'form': formfields.FormWrapper(manipulator, request.POST, errors),


@@ -227,7 +227,7 @@ class DateFormat(TimeFormat):
                 week_number = 1
             else:
                 j = day_of_year + (7 - weekday) + (jan1_weekday - 1)
-                week_number = j / 7
+                week_number = j // 7
                 if jan1_weekday > 4:
                     week_number -= 1
         return week_number


@@ -105,7 +105,7 @@ class DecoratorsTest(TestCase):
         """
         def my_view(request):
             return "response"
-        my_view_cached = cache_page(123, my_view)
+        my_view_cached = cache_page(my_view, 123)
         self.assertEqual(my_view_cached(HttpRequest()), "response")

 class MethodDecoratorAdapterTests(TestCase):


@@ -169,7 +169,7 @@ class SQLCompiler(object):
                 if isinstance(col, (list, tuple)):
                     alias, column = col
                     table = self.query.alias_map[alias][TABLE_NAME]
-                    if table in only_load and col not in only_load[table]:
+                    if table in only_load and column not in only_load[table]:
                         continue
                     r = '%s.%s' % (qn(alias), qn(column))
                     if with_aliases:


@@ -42,7 +42,7 @@ def check_settings(base_url=None):
     Checks if the staticfiles settings have sane values.

     """
-    if base_url is not None:
+    if base_url is None:
         base_url = settings.STATIC_URL
     if not base_url:
         raise ImproperlyConfigured(


@@ -37,7 +37,7 @@ class GeoSQLCompiler(compiler.SQLCompiler):
                 if isinstance(col, (list, tuple)):
                     alias, column = col
                     table = self.query.alias_map[alias][TABLE_NAME]
-                    if table in only_load and col not in only_load[table]:
+                    if table in only_load and column not in only_load[table]:
                         continue
                     r = self.get_field_select(field, alias, column)
                     if with_aliases:


@@ -111,5 +111,5 @@ class OSMWidget(BaseGeometryWidget):
             return 900913

     def render(self, name, value, attrs=None):
-        return super(self, OSMWidget).render(name, value,
+        return super(OSMWidget, self).render(name, value,
             {'default_lon': self.default_lon, 'default_lat': self.default_lat})


@@ -575,7 +575,7 @@ class SQLCompiler(object):
                 for order, order_params in ordering_group_by:
                     # Even if we have seen the same SQL string, it might have
                     # different params, so, we add same SQL in "has params" case.
-                    if order not in seen or params:
+                    if order not in seen or order_params:
                         result.append(order)
                         params.extend(order_params)
                         seen.add(order)


@@ -57,7 +57,7 @@ def check_password(password, encoded, setter=None, preferred='default'):

     must_update = hasher.algorithm != preferred.algorithm
     if not must_update:
-        must_update = hasher.must_update(encoded)
+        must_update = preferred.must_update(encoded)
     is_correct = hasher.verify(password, encoded)
     if setter and is_correct and must_update:
         setter(password)


@@ -228,7 +228,7 @@ class GenericRelationTests(TestCase):
         # then wrong results are produced here as the link to b will also match
         # (b and hs1 have equal pks).
         self.assertEqual(qs.count(), 1)
-        self.assertEqual(qs[0].links__sum, l.id)
+        self.assertEqual(qs[0].links__sum, hs1.id)
         l.delete()
         # Now if we don't have proper left join, we will not produce any
         # results at all here.


@@ -112,7 +112,7 @@ class ClassDecoratedTestCase(ClassDecoratedTestCaseSuper):

     @classmethod
     def setUpClass(cls):
-        super(cls, ClassDecoratedTestCase).setUpClass()
+        super(ClassDecoratedTestCase, cls).setUpClass()
         cls.foo = getattr(settings, 'TEST', 'BUG')

     def test_override(self):


@@ -23,7 +23,7 @@ def import_string(dotted_path):
         return getattr(module, class_name)
     except AttributeError:
         msg = 'Module "%s" does not define a "%s" attribute/class' % (
-            dotted_path, class_name)
+            module_path, class_name)
         six.reraise(ImportError, ImportError(msg), sys.exc_info()[2])


@@ -31,7 +31,7 @@ class DatabaseCreation(BaseDatabaseCreation):
                 try:
                     if verbosity >= 1:
                         print("Destroying old test database for alias %s..." % (
-                            self._get_database_display_str(target_database_name, verbosity),
+                            self._get_database_display_str(verbosity, target_database_name),
                         ))
                     cursor.execute("DROP DATABASE %s" % qn(target_database_name))
                     cursor.execute("CREATE DATABASE %s" % qn(target_database_name))


@@ -50,7 +50,7 @@ class SeparateDatabaseAndState(Operation):
             to_state = base_state.clone()
             for dbop in self.database_operations[:-(pos + 1)]:
                 dbop.state_forwards(app_label, to_state)
-            from_state = base_state.clone()
+            from_state = to_state.clone()
             database_operation.state_forwards(app_label, from_state)
             database_operation.database_backwards(app_label, schema_editor, from_state, to_state)


@@ -383,7 +383,7 @@ class CombinedExpression(Expression):
             return DurationExpression(self.lhs, self.connector, self.rhs).as_sql(compiler, connection)
         if (lhs_output and rhs_output and self.connector == self.SUB and
             lhs_output.get_internal_type() in {'DateField', 'DateTimeField', 'TimeField'} and
-                lhs_output.get_internal_type() == lhs_output.get_internal_type()):
+                lhs_output.get_internal_type() == rhs_output.get_internal_type()):
             return TemporalSubtraction(self.lhs, self.rhs).as_sql(compiler, connection)
         expressions = []
         expression_params = []


@@ -42,7 +42,7 @@ class PasswordResetTokenGenerator:
             return False

         # Check the timestamp is within limit
-        if (self._num_days(self._today()) - ts) >= settings.PASSWORD_RESET_TIMEOUT_DAYS:
+        if (self._num_days(self._today()) - ts) > settings.PASSWORD_RESET_TIMEOUT_DAYS:
             return False

         return True


@@ -60,7 +60,7 @@ class RWLock:
     def writer_enters(self):
         with self.mutex:
             if self.active_writers == 0 and self.waiting_writers == 0 and self.active_readers == 0:
-                self.active_writers += 1
+                self.active_writers = 1
                 self.can_write.release()
             else:
                 self.waiting_writers += 1


@@ -58,4 +58,4 @@ class Watcher(object):
     def _get_key(self, full_path):
         """Build a checksum used to identify this filepath"""
         full_path_checksum = hashlib.sha1(full_path).digest()
-        return full_path
+        return full_path_checksum


@@ -47,7 +47,7 @@ def read(data=None):
             metric.plugin = 'swift_stat'
             metric.interval = INTERVAL
             metric.type = 'gauge'
-            metric.type_instance = m_instance
+            metric.type_instance = name
             metric.values = [stats[m_instance]]
             metric.dispatch()
         else:


@@ -260,7 +260,7 @@ class identify():
             #index bam
             samtools_index_command = (
                 settings["samtools_call"], "index",
-                length_split_bam
+                strand_split_bam
                 )

             os.system(" ".join(samtools_index_command))


@@ -693,7 +693,7 @@ class identify():
                         input_bam
 #                        input_bam, "2>", featurecounts_info
                         )
-        with open(output_SAF) as f_out:
+        with open(input_SAF) as f_out:
             for line in f_out:
                 print(line)


@@ -850,7 +850,7 @@ class quantify():
             for j,pos in enumerate(genomic_seq):
                 if pos == "*":
                     genomic_seq_conv.append("*")
-                elif pos == consensus_seq[i]:
+                elif pos == consensus_seq[j]:
                     genomic_seq_conv.append(".")
                 else:
                     genomic_seq_conv.append(pos)


@@ -120,7 +120,7 @@ def main():
                    help="Specify the token secret on the command line (base32 encoded)")
     m.add_argument('-f', '--dotfile', type=PathType(exists=True), default=os.path.expanduser('~/.vipaccess'),
                    help="File in which the credential is stored (default ~/.vipaccess")
-    m.add_argument('-v', '--verbose', action='store_true')
+    pshow.add_argument('-v', '--verbose', action='store_true')
     pshow.set_defaults(func=show)

     p.set_default_subparser('show')


@@ -233,7 +233,7 @@ class AbstractEventBus(EventBus, abc.ABC):

         callbacks = self._subscribers.get((channel, pattern))

-        if callback:
+        if callbacks:
             callbacks.remove(callback)
             if len(callbacks) == 0:
                 del self._subscribers[(channel, pattern)]


@@ -89,7 +89,7 @@ class Device(object):
             "awk '{print $1}'",]))
         ips = out.split("\n")
         if out and not out.startswith("127.0.0.1"):
-            self._logger.debug("found IP addresses:" + str(out))
+            self._logger.debug("found IP addresses:" + str(ips))
             return out.split('\n')
         else:
             raise NoIPException("couldn't receive any IP address:'{}'".format(


@@ -79,7 +79,7 @@ class Page(StarlitModule):
                 return rv

     def set_page_and_response_if_appropriate(self):
-        if isinstance(request.routing_exception, NotFound) and current_page:
+        if not isinstance(request.routing_exception, NotFound) and current_page:
             return self.page_view()

     def _add_contenttype_handler(


@@ -29,7 +29,7 @@ class RobotTestLinkHelper(TestLinkHelper):

     def _get_missing_params_from_robot_variables(self, param_dict):
         for testlink_param, robot_variable in robot_report_params.items():
-            setdefault_if_not_none(param_dict, testlink_param, self._get_param_from_robot(testlink_param))
+            setdefault_if_not_none(param_dict, testlink_param, self._get_param_from_robot(robot_variable))

     def _setParamsFromRobot(self):
         """


@@ -160,7 +160,7 @@ def compute_indicatormatrix(orig, dest, orig_proj='latlong', dest_proj='latlong'
 def maybe_swap_spatial_dims(ds, namex='x', namey='y'):
     swaps = {}
     lx, rx = ds.indexes[namex][[0, -1]]
-    uy, ly = ds.indexes[namex][[0, -1]]
+    uy, ly = ds.indexes[namey][[0, -1]]

     if lx > rx:
         swaps[namex] = slice(None, None, -1)


@@ -96,7 +96,7 @@ class RequireJSCompiler(FilterBase):
         output = compressor.filter_output(filtered)
         path = compressor.get_filepath(output, basename=basename)
         # Write it
-        compressor.storage.save(path, ContentFile(content.encode(compressor.charset)))
+        compressor.storage.save(path, ContentFile(output.encode(compressor.charset)))
         return mark_safe(compressor.storage.url(path))

     #


@@ -385,7 +385,7 @@ class JagularFileMap(object):
                         timestamps = timestamps + timestamps_ # list concatenation
                         channel_data = np.hstack((channel_data, channel_data_))
                     if timestamps:
-                        yield timestamps, channel_data_
+                        yield timestamps, channel_data
                     else:
                         ii+=1
                 except IndexError:


@@ -54,7 +54,7 @@ class StatusUpdateThread(QThread):
                     slow_pz_pos_text = f"Slow Pz:{slow_pz_pos:.3f}"
                     refcell_pos_text = f"RefCell:{refcell_pos:.3f}"
                     stabilizing_text = f"Stabilize:{green_text('ON') if is_stabilizing else red_text('OFF')}"
-                    scanning_text = f"Scanning:{green_text('ON') if is_stabilizing else red_text('OFF')}"
+                    scanning_text = f"Scanning:{green_text('ON') if is_scanning else red_text('OFF')}"
                     locked_text = f"{green_text('LOCKED') if is_locked else red_text('NO LOCK')}"
                     wavemeter_text = f"Wavemeter:{wavemeter_value}"


@@ -59,7 +59,7 @@ def setup_logging(handler, exclude=['raven', 'sentry.errors']):
     Returns a boolean based on if logging was configured or not.
     """
     logger = logging.getLogger()
-    if handler.__class__ not in map(type, logger.handlers):
+    if handler.__class__ in map(type, logger.handlers):
         return False

     logger.addHandler(handler)


@@ -16,7 +16,7 @@ class TransportRegistry(object):
                 self.register_transport(transport)

     def register_transport(self, transport):
-        if not hasattr(transport, 'scheme') and not hasattr(transport.scheme, '__iter__'):
+        if not hasattr(transport, 'scheme') or not hasattr(transport.scheme, '__iter__'):
             raise AttributeError('Transport %s must have a scheme list', transport.__class__.__name__)

         for scheme in transport.scheme:


@@ -29,4 +29,4 @@ class StrLengthDict(dict):
         if key in self:
             raise KeyError('Key already exists')

-        super().__setitem__(key, (len(key), value))
+        super().__setitem__(key, (len(value), value))


@@ -30,7 +30,7 @@ class Gemini( object ):
 		argStringb64 = b64encode( bytes( argString, "utf-8" ) ).decode( "utf-8" )
 		signature = hmac.new(
 				bytes( self.__private, 'utf-8' ),
-				bytes( argString, 'utf-8' ),
+				bytes( argStringb64, 'utf-8' ),
 				sha384 )
 		headerPayload = {
 			'X-GEMINI-APIKEY': self.__public,


@@ -316,7 +316,7 @@ class Notifier(Persistent):
             di['commenttext'] = safe_unicode(comment.getText())
         subscriptions = getUtility(ISubscriptions)
         subscribers = set(subscriptions.subscribers_for(thread)) | set(subscriptions.subscribers_for(forum))
-        mdtool = getToolByName(comment, 'portal_memberdata')
+        mdtool = getToolByName(thread, 'portal_memberdata')
         keys = mdtool.propertyIds()
         for mdata in subscribers:
             if (comment is not None) and (mdata.getId() == comment.Creator()):


@@ -10,7 +10,7 @@ def validate_request(schema):
             context = DrfUtils.get_request_parameters(request)
             context = SchemaValidator.validate(context, schema)
             kwargs['context'] = context
-            return view_func(request, *args, **kwargs)
+            return view_func(view, *args, **kwargs)

         return _wrapped_view


@@ -51,7 +51,7 @@ class inmet:
             self.lat = inmet.sites.loc[code].lat
             self.lon = inmet.sites.loc[code].lon
             self.alt = inmet.sites.loc[code].alt
-        self.dados = get_from_ldb(code, db, local)
+        self.dados = get_from_ldb(code, local, db)

     def resample(self, periodo):
         metodos = {'Temperatura': np.mean, 'Temperatura_max': np.max,


@@ -86,7 +86,7 @@ trajdefaults = dict(
 );

 def trajectories(ret,trajs,**kw):
-    getkw=mk_getkw(trajdefaults, kw);
+    getkw=mk_getkw(kw, trajdefaults);
     x,y = getkw("coords");
     if not test(kw, "no_resize"):
         xlim, ylim = ret['axes'].get_xlim(), ret['axes'].get_ylim();


@@ -25,7 +25,7 @@ class xnd(_xnd):
                     "the 'type' and 'levels' arguments are mutually exclusive")
             elif isinstance(type, str):
                 type = ndt(type)
-        return _xnd(value, type)
+        return _xnd(type, value)

     @classmethod
     def empty(cls, t):


@@ -243,7 +243,7 @@ class SinglePackPutaway(Component):
         if not pack_transfer.is_dest_location_valid(move, scanned_location):
             return self._response_for_forbidden_location()

-        if not pack_transfer.is_dest_location_to_confirm(move, scanned_location):
+        if pack_transfer.is_dest_location_to_confirm(move, scanned_location):
             if confirmation:
                 # keep the move in sync otherwise we would have a move line outside
                 # the dest location of the move


@@ -40,7 +40,7 @@ class PackTransferValidateAction(Component):
         zone_locations = self.env["stock.location"].search(
             [("id", "child_of", move_dest_location.id)]
         )
-        return scanned_location in zone_locations
+        return scanned_location not in zone_locations

     def set_destination_and_done(self, move, scanned_location):

ReplaceText(target=' not in ' @(43,31)->(43,35))


@@ -245,7 +245,7 @@ class SinglePackTransfer(Component):
         if not pack_transfer.is_dest_location_valid(move, scanned_location):
             return self._response_for_forbidden_location()

-        if not pack_transfer.is_dest_location_to_confirm(move, scanned_location):
+        if pack_transfer.is_dest_location_to_confirm(move, scanned_location):
             if confirmation:
                 # keep the move in sync otherwise we would have a move line outside
                 # the dest location of the move


@@ -19,7 +19,7 @@ class SelectDestPackageMixin:
                     "partner": {"id": self.customer.id, "name": self.customer.name},
                 },
                 "packages": [
-                    self._package_data(picking, package) for package in packages
+                    self._package_data(package, picking) for package in packages
                 ],
                 "selected_move_lines": [
                     self._move_line_data(ml) for ml in selected_lines.sorted()


@@ -193,7 +193,7 @@ class StockMove(models.Model):
                 new_move_per_location[routing_location.id].append(new_move_id)

         new_moves = self.browse(chain.from_iterable(new_move_per_location.values()))
-        return self + new_moves
+        return self | new_moves

     def _apply_routing_rule_pull(self):
         """Apply routing operations


@@ -77,7 +77,7 @@ class ScalarMetricCollection:
             else:
                 value = attr
             self.writer.add_scalar(tag_name, scalar_value=value, global_step=step)
-            self.values[attr_name].append(dc_value)
+            self.values[attr_name].append(value)

     def epoch_finished(self, epoch_num: int):
         if self.report_average:


@@ -86,7 +86,7 @@ class DataPointManager(AbstractMicroservice):
             _config_methods[key] = m

         for config_data_point in self._config["datapoints"]:
-            dp = DataPoint(config_data_point, _config_methods, self._logger, self._mqtt_client,
+            dp = DataPoint(config_data_point, _config_methods, self._mqtt_client, self._logger,
                            self._no_data_behavior)
             self._purges.append(dp.purge_old_values)
             for method in dp.methods:


@@ -61,7 +61,7 @@ class DomainPlugin(Plugin):
         strowger = StrowgerClient(api_ip)

         for domain, data in domains.items():
-            service_name = domain.get('http')
+            service_name = data.get('http')
             if not service_name:
                 continue
             strowger.set_http_route(domain, service_name)


@@ -43,7 +43,7 @@ def connectMongo():
     client=pymongo.MongoClient(aa.mongouri)
     shouts=client.aaserver.shouts.find({})
     shouts_=[shout for shout in shouts]
-    return shouts
+    return shouts_

 def accessIrcLog():
     with codecs.open("../../social/data/irc/labmacambira_lalenia3.txt","rb","iso-8859-1")  as f:


@@ -399,7 +399,7 @@ class Update:
         tagging.expand_all_destinations()
         tagging.to_file(tag_filepath)
         log.info('[-] Output %d tagging rules to %s' % (
-                        len(tagging), tax_filepath))
+                        len(tagging), tag_filepath))
         expansion.to_file(exp_filepath)
         log.info('[-] Output %d expansion rules to %s' % (
                         len(expansion), exp_filepath))


@@ -288,7 +288,7 @@ def test_get_best_terminal_steiner_tree(load_pkl_evolve):

     evolution = evolve.run_evolution(vertices, terminals, 5, n=16, n1=2, n2=8)
     genes = evolve.get_best_individual(evolution)
-    tst = evolve.get_best_terminal_steiner_tree(vertices, terminals, genes)
+    tst = evolve.get_best_terminal_steiner_tree(vertices, terminals, evolution)
     w1 = tst['weight'].sum()
     w2 = evolution.at[len(evolution)-1,'weight']


@@ -102,7 +102,7 @@ def reconstruct_rogues(params):
     for j, rogue in enumerate(rogues):
       reflections['id'][ann.nn[j]] = 1701

-    rogues = reflections.select(reflections['id'] == 1701)
+    reflections = reflections.select(reflections['id'] == 1701)

     if params.extract:
       reflections["shoebox"] = flex.shoebox(


@@ -330,7 +330,7 @@ class DialsScaler(Scaler):
           Debug.write('X1698: %s: %s' % (pointgroup, reindex_op))

           if ntr:
-            integrater.integrater_reset_reindex_operator()
+            intgr.integrater_reset_reindex_operator()
             need_to_return = True

         if pt and not probably_twinned: