max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
upcfcardsearch/c8.py
ProfessorSean/Kasutamaiza
0
3900
<gh_stars>0 import discord from discord.ext import commands from discord.utils import get class c8(commands.Cog, name="c8"): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command(name='Sacrosanct_Devouring_Pyre', aliases=['c8']) async def example_embed(self, ctx): embed =...
import discord from discord.ext import commands from discord.utils import get class c8(commands.Cog, name="c8"): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command(name='Sacrosanct_Devouring_Pyre', aliases=['c8']) async def example_embed(self, ctx): embed = discord.Emb...
none
1
2.828238
3
SVMmodel_withSKF.py
tameney22/DCI-Capstone
0
3901
""" This script is where the preprocessed data is used to train the SVM model to perform the classification. I am using Stratified K-Fold Cross Validation to prevent bias and/or any imbalance that could affect the model's accuracy. REFERENCE: https://medium.com/@bedigunjit/simple-guide-to-text-classification-nlp-usin...
""" This script is where the preprocessed data is used to train the SVM model to perform the classification. I am using Stratified K-Fold Cross Validation to prevent bias and/or any imbalance that could affect the model's accuracy. REFERENCE: https://medium.com/@bedigunjit/simple-guide-to-text-classification-nlp-usin...
en
0.714222
This script is where the preprocessed data is used to train the SVM model to perform the classification. I am using Stratified K-Fold Cross Validation to prevent bias and/or any imbalance that could affect the model's accuracy. REFERENCE: https://medium.com/@bedigunjit/simple-guide-to-text-classification-nlp-using-sv...
3.530994
4
red_dwarf/entrypoints/project_management.py
JesseMaitland/red-dwarf
0
3902
<gh_stars>0 from rsterm import EntryPoint from red_dwarf.project import provide_project_context, ProjectContext class InitProject(EntryPoint): @provide_project_context def run(self, project_context: ProjectContext) -> None: project_context.init_project()
from rsterm import EntryPoint from red_dwarf.project import provide_project_context, ProjectContext class InitProject(EntryPoint): @provide_project_context def run(self, project_context: ProjectContext) -> None: project_context.init_project()
none
1
1.412374
1
src/consensus.py
dschwoerer/samscripts
0
3903
<reponame>dschwoerer/samscripts #! /usr/bin/env python # Copyright <NAME>, 2015. www.sovic.org # # Creates a pileup from a given SAM/BAM file, and calls consensus bases (or variants). import os import sys import operator import subprocess def increase_in_dict(dict_counter, value): try: dict_counter[valu...
#! /usr/bin/env python # Copyright <NAME>, 2015. www.sovic.org # # Creates a pileup from a given SAM/BAM file, and calls consensus bases (or variants). import os import sys import operator import subprocess def increase_in_dict(dict_counter, value): try: dict_counter[value] += 1 except: dict...
en
0.708751
#! /usr/bin/env python # Copyright <NAME>, 2015. www.sovic.org # # Creates a pileup from a given SAM/BAM file, and calls consensus bases (or variants). # Split the line, and perform a sanity check. # Replace the '.' and ',' signs with the actual reference base. # print 'position: %s' % position; # print 'bases: "%s"' %...
2.46052
2
web/addons/account_payment/wizard/account_payment_populate_statement.py
diogocs1/comps
0
3904
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
en
0.656455
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
1.847701
2
libqtile/widget/imapwidget.py
akloster/qtile
1
3905
# -*- coding: utf-8 -*- # Copyright (c) 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
# -*- coding: utf-8 -*- # Copyright (c) 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
en
0.790998
# -*- coding: utf-8 -*- # Copyright (c) 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
1.764593
2
game/views/tests/game_definition_view_test.py
dimadk24/english-fight-api
0
3906
<reponame>dimadk24/english-fight-api from rest_framework.response import Response from rest_framework.test import APIClient from game.models import GameDefinition, AppUser def create_game_definition(api_client: APIClient) -> Response: return api_client.post("/api/game_definition") def get_game_definition(api_c...
from rest_framework.response import Response from rest_framework.test import APIClient from game.models import GameDefinition, AppUser def create_game_definition(api_client: APIClient) -> Response: return api_client.post("/api/game_definition") def get_game_definition(api_client: APIClient, game_def_id: str) -...
none
1
2.630384
3
2-Python-Fundamentals (Jan 2021)/Course-Exercises-and-Exams/08-Text-Processing/01_Lab/02-Repeat-Strings.py
karolinanikolova/SoftUni-Software-Engineering
0
3907
# 2. Repeat Strings # Write a Program That Reads a list of strings. Each string is repeated N times, where N is the length of the string. Print the concatenated string. strings = input().split() output_string = "" for string in strings: N = len(string) output_string += string * N print(output_string)
# 2. Repeat Strings # Write a Program That Reads a list of strings. Each string is repeated N times, where N is the length of the string. Print the concatenated string. strings = input().split() output_string = "" for string in strings: N = len(string) output_string += string * N print(output_string)
en
0.892518
# 2. Repeat Strings # Write a Program That Reads a list of strings. Each string is repeated N times, where N is the length of the string. Print the concatenated string.
4.374376
4
cloudkeeperV1/plugins/cleanup_aws_loadbalancers/test/test_args.py
mesosphere/cloudkeeper
99
3908
from cklib.args import get_arg_parser, ArgumentParser from cloudkeeper_plugin_cleanup_aws_loadbalancers import CleanupAWSLoadbalancersPlugin def test_args(): arg_parser = get_arg_parser() CleanupAWSLoadbalancersPlugin.add_args(arg_parser) arg_parser.parse_args() assert ArgumentParser.args.cleanup_aws_...
from cklib.args import get_arg_parser, ArgumentParser from cloudkeeper_plugin_cleanup_aws_loadbalancers import CleanupAWSLoadbalancersPlugin def test_args(): arg_parser = get_arg_parser() CleanupAWSLoadbalancersPlugin.add_args(arg_parser) arg_parser.parse_args() assert ArgumentParser.args.cleanup_aws_...
none
1
2.091528
2
mayan/apps/metadata/migrations/0011_auto_20180917_0645.py
prezi/mayan-edms
4
3909
<reponame>prezi/mayan-edms<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-09-17 06:45 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('metadata', '0010_auto_20180823_2353'), ] ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-09-17 06:45 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('metadata', '0010_auto_20180823_2353'), ] operations = [ migrations.AlterFi...
en
0.598337
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-09-17 06:45
1.605343
2
algorithm/dfs/boj_1260.py
ruslanlvivsky/python-algorithm
3
3910
<filename>algorithm/dfs/boj_1260.py def dfs(V): print(V, end=' ') visited[V] = True for n in graph[V]: if not visited[n]: dfs(n) def dfs_s(V): stack = [V] visited[V] = True while stack: now = stack.pop() print(now, end=' ') for n in graph[now]: ...
<filename>algorithm/dfs/boj_1260.py def dfs(V): print(V, end=' ') visited[V] = True for n in graph[V]: if not visited[n]: dfs(n) def dfs_s(V): stack = [V] visited[V] = True while stack: now = stack.pop() print(now, end=' ') for n in graph[now]: ...
none
1
3.366477
3
redirector.py
UKPLab/DiGAT
8
3911
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app __author__ = "<NAME>, <NAME>, and <NAME>" __copyright__ = "Copyright 2013-2015 UKP TU Darmstadt" __credits__ = ["<NAME>", "<NAME>", "<NAME>"] __license__ = "ASL" class Redirector(webapp.RequestHandler): def get(self)...
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app __author__ = "<NAME>, <NAME>, and <NAME>" __copyright__ = "Copyright 2013-2015 UKP TU Darmstadt" __credits__ = ["<NAME>", "<NAME>", "<NAME>"] __license__ = "ASL" class Redirector(webapp.RequestHandler): def get(self)...
none
1
2.447238
2
imgaug/augmenters/flip.py
pAoenix/image-Augmented
1
3912
<reponame>pAoenix/image-Augmented """ Augmenters that apply mirroring/flipping operations to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Fliplr((0.0, 1.0)), ...
""" Augmenters that apply mirroring/flipping operations to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Fliplr((0.0, 1.0)), iaa.Flipud((0.0, 1.0)) ]) Lis...
en
0.415252
Augmenters that apply mirroring/flipping operations to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Fliplr((0.0, 1.0)), iaa.Flipud((0.0, 1.0)) ]) List of...
2.642353
3
2. Add Two Numbers DC(12-1-21).py
Dharaneeshwar/Leetcode
4
3913
# Time Complexity - O(n) ; Space Complexity - O(n) class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: carry = 0 out = temp = ListNode() while l1 is not None and l2 is not None: tempsum = l1.val + l2.val tempsum += carry ...
# Time Complexity - O(n) ; Space Complexity - O(n) class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: carry = 0 out = temp = ListNode() while l1 is not None and l2 is not None: tempsum = l1.val + l2.val tempsum += carry ...
en
0.423504
# Time Complexity - O(n) ; Space Complexity - O(n)
3.702807
4
deepgp_dsvi/demos/step_function.py
dks28/Deep-Gaussian-Process
21
3914
<reponame>dks28/Deep-Gaussian-Process import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from gpflow.kernels import White, RBF from gpflow.likelihoods import Gaussian from deep_gp import DeepGP np.random.seed(0) tf.random.set_seed(0) def get_data(): Ns = 300 Xs = np.linspace(-0.5, 1....
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from gpflow.kernels import White, RBF from gpflow.likelihoods import Gaussian from deep_gp import DeepGP np.random.seed(0) tf.random.set_seed(0) def get_data(): Ns = 300 Xs = np.linspace(-0.5, 1.5, Ns)[:, None] N, M = 50, 25 ...
en
0.858264
# init hidden layers to be near deterministic
2.342621
2
metaspace/engine/sm/engine/annotation_lithops/moldb_pipeline.py
METASPACE2020/METASPACE
32
3915
from __future__ import annotations import json import logging from contextlib import contextmanager, ExitStack from typing import List, Dict import pandas as pd from lithops.storage import Storage from lithops.storage.utils import CloudObject, StorageNoSuchKeyError from sm.engine.annotation_lithops.build_moldb impor...
from __future__ import annotations import json import logging from contextlib import contextmanager, ExitStack from typing import List, Dict import pandas as pd from lithops.storage import Storage from lithops.storage.utils import CloudObject, StorageNoSuchKeyError from sm.engine.annotation_lithops.build_moldb impor...
en
0.935611
# type: ignore # https://github.com/python/mypy/issues/4122 # Include the `targeted` value of databases so that a new cache entry is made if # someone manually changes that field # Remove database_ids as it may be in a different order to moldbs # If Lithops' storage supported Copy Object operations, this could be easil...
1.816938
2
gui/main_window/node_editor/items/connector_top_item.py
anglebinbin/Barista-tool
1
3916
from PyQt5.QtWidgets import QMenu from gui.main_window.node_editor.items.connector_item import ConnectorItem class ConnectorTopItem(ConnectorItem): """ Class to provide top connector functionality """ def __init__(self, index, nodeItem, nodeEditor, parent=None): super(ConnectorTopItem, self).__init_...
from PyQt5.QtWidgets import QMenu from gui.main_window.node_editor.items.connector_item import ConnectorItem class ConnectorTopItem(ConnectorItem): """ Class to provide top connector functionality """ def __init__(self, index, nodeItem, nodeEditor, parent=None): super(ConnectorTopItem, self).__init_...
en
0.815239
Class to provide top connector functionality Returns whether the connector is a top connector (implementation for parent class) Returns whether the connector is connected to a in-place working layer A top connector is in place if any connected bottom connector is in place. (implementation for pa...
3.020978
3
modules/platforms/python/pyignite/api/key_value.py
DirectXceriD/gridgain
1
3917
<gh_stars>1-10 # GridGain Community Edition Licensing # Copyright 2019 GridGain Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause # Restriction; you may not use this file except in compliance with the License. You may obtain...
# GridGain Community Edition Licensing # Copyright 2019 GridGain Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause # Restriction; you may not use this file except in compliance with the License. You may obtain a # copy of th...
en
0.736578
# GridGain Community Edition Licensing # Copyright 2019 GridGain Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause # Restriction; you may not use this file except in compliance with the License. You may obtain a # copy of th...
1.56568
2
wrt/wrt-manifest-tizen-tests/const.py
linshen/crosswalk-test-suite
0
3918
#!/usr/bin/env python import sys, os import itertools, shutil path = os.path.abspath(__file__) path = os.path.split(path)[0] os.chdir(path) print path device_ssh_ip = "" ssh_device = device_ssh_ip.split(",") path_tcs = path + "/tcs" path_result= path + "/result" path_allpairs = path + "/allpairs" path_resource = path ...
#!/usr/bin/env python import sys, os import itertools, shutil path = os.path.abspath(__file__) path = os.path.split(path)[0] os.chdir(path) print path device_ssh_ip = "" ssh_device = device_ssh_ip.split(",") path_tcs = path + "/tcs" path_result= path + "/result" path_allpairs = path + "/allpairs" path_resource = path ...
ru
0.26433
#!/usr/bin/env python
2.273072
2
api/src/opentrons/protocol_engine/commands/thermocycler/open_lid.py
Opentrons/protocol_framework
0
3919
<reponame>Opentrons/protocol_framework """Command models to open a Thermocycler's lid.""" from __future__ import annotations from typing import Optional, TYPE_CHECKING from typing_extensions import Literal, Type from pydantic import BaseModel, Field from ..command import AbstractCommandImpl, BaseCommand, BaseCommandC...
"""Command models to open a Thermocycler's lid.""" from __future__ import annotations from typing import Optional, TYPE_CHECKING from typing_extensions import Literal, Type from pydantic import BaseModel, Field from ..command import AbstractCommandImpl, BaseCommand, BaseCommandCreate from opentrons.protocol_engine.ty...
en
0.652499
Command models to open a Thermocycler's lid. Input parameters to open a Thermocycler's lid. Result data from opening a Thermocycler's lid. Execution implementation of a Thermocycler's open lid command. Open a Thermocycler's lid. # move the pipettes and gantry over the trash # do not home plunger axes because pipettes m...
2.506487
3
deep_utils/nlp/utils/utils.py
pooya-mohammadi/deep_utils
36
3920
def multiple_replace(text: str, chars_to_mapping: dict): """ This function is used to replace a dictionary of characters inside a text string :param text: :param chars_to_mapping: :return: """ import re pattern = "|".join(map(re.escape, chars_to_mapping.keys())) return re.sub(patter...
def multiple_replace(text: str, chars_to_mapping: dict): """ This function is used to replace a dictionary of characters inside a text string :param text: :param chars_to_mapping: :return: """ import re pattern = "|".join(map(re.escape, chars_to_mapping.keys())) return re.sub(patter...
en
0.515369
This function is used to replace a dictionary of characters inside a text string :param text: :param chars_to_mapping: :return:
4.128075
4
apps/gamedoc/models.py
mehrbodjavadi79/AIC21-Backend
3
3921
<reponame>mehrbodjavadi79/AIC21-Backend<filename>apps/gamedoc/models.py from django.db import models # Create your models here. class Gamedoc(models.Model): link = models.URLField(max_length=500) title = models.CharField(max_length=500) repo_name = models.CharField(max_length=512, blank=True, null=True) ...
from django.db import models # Create your models here. class Gamedoc(models.Model): link = models.URLField(max_length=500) title = models.CharField(max_length=500) repo_name = models.CharField(max_length=512, blank=True, null=True) user_name = models.CharField(max_length=512, blank=True, null=True) ...
en
0.963489
# Create your models here.
2.386826
2
assignment/users/admin.py
LongNKCoder/SD4456_Python_Assignment_2
0
3922
from django.contrib import admin from users.models import Friendship admin.site.register(Friendship) # Register your models here.
from django.contrib import admin from users.models import Friendship admin.site.register(Friendship) # Register your models here.
en
0.968259
# Register your models here.
1.394032
1
python/Word/demo_doc.py
davidgjy/arch-lib
0
3923
import docx doc = docx.Document('demo.docx') print('paragraphs number: %s' % len(doc.paragraphs)) print('1st paragraph: %s' % doc.paragraphs[0].text) print('2nd paragraph: %s' % doc.paragraphs[1].text) print('paragraphs runs: %s' % len(doc.paragraphs[1].runs)) print('1st paragraph run: %s' % doc.paragraphs[1].r...
import docx doc = docx.Document('demo.docx') print('paragraphs number: %s' % len(doc.paragraphs)) print('1st paragraph: %s' % doc.paragraphs[0].text) print('2nd paragraph: %s' % doc.paragraphs[1].text) print('paragraphs runs: %s' % len(doc.paragraphs[1].runs)) print('1st paragraph run: %s' % doc.paragraphs[1].r...
none
1
3.392256
3
src/GL/sim/gql_ql_sims_ml_analysis.py
kylmcgr/RL-RNN-SURF
2
3924
<reponame>kylmcgr/RL-RNN-SURF<filename>src/GL/sim/gql_ql_sims_ml_analysis.py # Analysis the data generated from on policy simulations of QL, QLP and GQL. from BD.sim.sims import sims_analysis, merge_sim_files, extract_run_rew from BD.util.paths import Paths def sims_analysis_BD(): input_folder = Paths.rest_path ...
# Analysis the data generated from on policy simulations of QL, QLP and GQL. from BD.sim.sims import sims_analysis, merge_sim_files, extract_run_rew from BD.util.paths import Paths def sims_analysis_BD(): input_folder = Paths.rest_path + 'archive/beh/qlp-ml-opt/qlp-ml/' sims_analysis(input_folder, ...
en
0.825348
# Analysis the data generated from on policy simulations of QL, QLP and GQL.
1.785699
2
scripts/randomize_sw2_seed.py
epichoxha/nanodump
0
3925
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import glob import random import struct def get_old_seed(): with open('include/syscalls.h') as f: code = f.read() match = re.search(r'#define SW2_SEED (0x[a-fA-F0-9]{8})', code) assert match is not None, 'SW2_SEED not found!' ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import glob import random import struct def get_old_seed(): with open('include/syscalls.h') as f: code = f.read() match = re.search(r'#define SW2_SEED (0x[a-fA-F0-9]{8})', code) assert match is not None, 'SW2_SEED not found!' ...
en
0.368194
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #new_seed = 0x1337c0de
2.437002
2
checker/checker/executer.py
grimpy/hexa-a
3
3926
<filename>checker/checker/executer.py from subprocess import run, PIPE, TimeoutExpired, CompletedProcess from codes import exitcodes def _error_decode(response): stderr = "" if response.returncode: if response.returncode < 0: errmsg = exitcodes.get(abs(response.returncode), "Unknown Error")...
<filename>checker/checker/executer.py from subprocess import run, PIPE, TimeoutExpired, CompletedProcess from codes import exitcodes def _error_decode(response): stderr = "" if response.returncode: if response.returncode < 0: errmsg = exitcodes.get(abs(response.returncode), "Unknown Error")...
none
1
2.314029
2
pfm/pf_command/update.py
takahi-i/pfm
9
3927
<reponame>takahi-i/pfm import json from pfm.pf_command.base import BaseCommand from pfm.util.log import logger class UpdateCommand(BaseCommand): def __init__(self, name, forward_type, remote_host, remote_port, local_port, ssh_server, server_port, login_user, config): sup...
import json from pfm.pf_command.base import BaseCommand from pfm.util.log import logger class UpdateCommand(BaseCommand): def __init__(self, name, forward_type, remote_host, remote_port, local_port, ssh_server, server_port, login_user, config): super(UpdateCommand, self)...
en
0.550276
# write the target
2.576909
3
tests/atfork/test_atfork.py
luciferliu/xTools
0
3928
<reponame>luciferliu/xTools #!/usr/bin/python # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
#!/usr/bin/python # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
en
0.878757
#!/usr/bin/python # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
2.032219
2
IO/files/handling.py
brendano257/Zugspitze-Schneefernerhaus
0
3929
import os from pathlib import Path __all__ = ['list_files_recur', 'scan_and_create_dir_tree', 'get_all_data_files', 'get_subsubdirs'] def list_files_recur(path): """ Cheater function that wraps path.rglob(). :param Path path: path to list recursively :return list: list of Path objects """ fi...
import os from pathlib import Path __all__ = ['list_files_recur', 'scan_and_create_dir_tree', 'get_all_data_files', 'get_subsubdirs'] def list_files_recur(path): """ Cheater function that wraps path.rglob(). :param Path path: path to list recursively :return list: list of Path objects """ fi...
en
0.778054
Cheater function that wraps path.rglob(). :param Path path: path to list recursively :return list: list of Path objects Creates all the necessary directories for the file at the end of path to be created. When specified with a filepath to a file or folder, it creates directories until the path is valid. ...
3.56409
4
tools/mo/openvino/tools/mo/ops/detection_output_onnx.py
ryanloney/openvino-1
1,127
3930
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.front.common.partial_infer.utils import dynamic_dimension_value, shape_array, set_input_shapes from openvino.tools.mo.ops.op import Op class ExperimentalDetectronDetectionOutput(Op): op = ...
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.front.common.partial_infer.utils import dynamic_dimension_value, shape_array, set_input_shapes from openvino.tools.mo.ops.op import Op class ExperimentalDetectronDetectionOutput(Op): op = ...
en
0.565381
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # boxes # classes, scores, batch indices # We use range(1, 1 + max(node.out_ports().keys())) instead of range(1, 3), because there are incorrectly # generated models where ExperimentalDetectronDetectionOutput has 4 outputs. # the second o...
1.795869
2
driver.py
FahimMahmudJoy/Physionet_2019_Sepsis
1
3931
#!/usr/bin/env python import numpy as np, os, sys from get_sepsis_score import load_sepsis_model, get_sepsis_score def load_challenge_data(file): with open(file, 'r') as f: header = f.readline().strip() column_names = header.split('|') data = np.loadtxt(f, delimiter='|') # Ignore Seps...
#!/usr/bin/env python import numpy as np, os, sys from get_sepsis_score import load_sepsis_model, get_sepsis_score def load_challenge_data(file): with open(file, 'r') as f: header = f.readline().strip() column_names = header.split('|') data = np.loadtxt(f, delimiter='|') # Ignore Seps...
en
0.330637
#!/usr/bin/env python # Ignore SepsisLabel column if present. # Parse arguments. # Find files. # Load model. # Iterate over files. # Load data. # print(type(data)) # Make predictions. # Save results.
2.85764
3
src/LspRuntimeMonitor.py
TafsirGna/ClspGeneticAlgorithm
0
3932
<gh_stars>0 #!/usr/bin/python3.5 # -*-coding: utf-8 -* from collections import defaultdict from threading import Thread from time import perf_counter, time from LspLibrary import bcolors import time import matplotlib.pyplot as plt class LspRuntimeMonitor: """ """ clockStart = None clockEnd = None ...
#!/usr/bin/python3.5 # -*-coding: utf-8 -* from collections import defaultdict from threading import Thread from time import perf_counter, time from LspLibrary import bcolors import time import matplotlib.pyplot as plt class LspRuntimeMonitor: """ """ clockStart = None clockEnd = None mutation_s...
en
0.667095
#!/usr/bin/python3.5 # -*-coding: utf-8 -* # Thread(cls.waitingAnimation()) # Duration # Saving all generated output to a default file # Plots # Plotting the evolution of the minimal cost over generations # Plotting the evolution of the minimal cost over generations # while thing_not_complete():
2.601914
3
core/github/parsers/__init__.py
goranc/GraphYourCodeVulnerability
0
3933
from .python.parser import PythonParser all_parsers = [PythonParser]
from .python.parser import PythonParser all_parsers = [PythonParser]
none
1
1.124685
1
methylcheck/predict/sex.py
FoxoTech/methylcheck
0
3934
<reponame>FoxoTech/methylcheck<filename>methylcheck/predict/sex.py import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path #app import methylcheck # uses .load; get_sex uses methylprep models too and detect_array() import logging LOGGER = logging.getLogger(...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pathlib import Path #app import methylcheck # uses .load; get_sex uses methylprep models too and detect_array() import logging LOGGER = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) def _get_copy_n...
en
0.800489
#app # uses .load; get_sex uses methylprep models too and detect_array() function to return copy number. requires dataframes of methylated and unmethylated values. can be raw OR corrected # minfi R version: # log2(getMeth(object) + getUnmeth(object)) This will calculate and predict the sex of each sample. inpu...
2.591713
3
backend/accounts/migrations/0003_auto_20201115_1537.py
mahmoud-batman/quizz-app
0
3935
# Generated by Django 3.1.2 on 2020-11-15 15:37 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0002_auto_20201115_1531'), ] operations = [ migrations.AlterField( model_name='customu...
# Generated by Django 3.1.2 on 2020-11-15 15:37 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0002_auto_20201115_1531'), ] operations = [ migrations.AlterField( model_name='customu...
en
0.779038
# Generated by Django 3.1.2 on 2020-11-15 15:37
1.748109
2
tests/test_basics.py
sirosen/git-fortune
0
3936
<reponame>sirosen/git-fortune<filename>tests/test_basics.py import subprocess from git_fortune._compat import fix_line_endings from git_fortune.version import __version__ def test_help(capfd): subprocess.check_call(["git-fortune", "-h"]) captured = capfd.readouterr() assert ( fix_line_endings( ...
import subprocess from git_fortune._compat import fix_line_endings from git_fortune.version import __version__ def test_help(capfd): subprocess.check_call(["git-fortune", "-h"]) captured = capfd.readouterr() assert ( fix_line_endings( """ A fortune-like command for showing git tips I...
en
0.670055
A fortune-like command for showing git tips Invoke it as 'git-fortune' or 'git fortune' \ +-------------------------------------------------------------------------------+ | GIT TIP #3 | | ...
2.488741
2
configs/keypoints/faster_rcnn_r50_fpn_keypoints.py
VGrondin/CBNetV2_mask_remote
0
3937
<reponame>VGrondin/CBNetV2_mask_remote<gh_stars>0 _base_ = [ '../_base_/models/faster_rcnn_r50_fpn.py' ] model = dict( type='FasterRCNN', # pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen...
_base_ = [ '../_base_/models/faster_rcnn_r50_fpn.py' ] model = dict( type='FasterRCNN', # pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requir...
en
0.411668
# pretrained='torchvision://resnet50', # type='StandardRoIHead', # keypoint_head=dict( # type='HRNetKeypointHead', # num_convs=8, # in_channels=256, # features_size=[256, 256, 256, 256], # conv_out_channels=512, # num_keypoints=5, # loss_keypoint=dict(type='MSELoss', loss_weight=50.0)), #opt...
1.660322
2
maskrcnn_benchmark/layers/roi_align_rotated_3d.py
picwoon/As_built_BIM
2
3938
<reponame>picwoon/As_built_BIM # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch, math from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair from SparseConvNet.sparseconvnet.tools_3d_2d...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch, math from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair from SparseConvNet.sparseconvnet.tools_3d_2d import sparse_3d_to_dense_2d i...
en
0.72538
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # input: [4, 256, 304, 200, 7] # roi: [171, 8] # spatial_scale: 0.25 # output_size: [7,7,7] # sampling_ratio: 2 # [171, 256, 7, 7] output_size:[pooled_height, pooled_width] spatial_scale: size_of_map/size_of_original_image sampling_...
1.918037
2
src/model/utils/utils.py
J-CITY/METADATA-EXTRACTOR
0
3939
<reponame>J-CITY/METADATA-EXTRACTOR<filename>src/model/utils/utils.py import numpy as np import os from .logger import printLog UNK = "$UNK$" NUM = "$NUM$" NONE = "O" class ParrotIOError(Exception): def __init__(self, filename): message = "ERROR: Can not find file {}.".format(filename) super(Parro...
import numpy as np import os from .logger import printLog UNK = "$UNK$" NUM = "$NUM$" NONE = "O" class ParrotIOError(Exception): def __init__(self, filename): message = "ERROR: Can not find file {}.".format(filename) super(ParrotIOError, self).__init__(message) # Class that iterates over CoNLL Da...
en
0.789475
# Class that iterates over CoNLL Dataset # function that takes a word as input # function that takes a tag as input # max number of sentences to yield # delete spaces in start and end #Create a dictionary from dataset #filename - path wo file with vectors #glove coords # store glove matrix # char ids for word # word id...
2.940637
3
noxfile.py
fatcat2/biggestContributor
2
3940
import nox FILE_PATHS = ["utils", "main.py"] @nox.session def format(session): session.install("black") session.run("black", *FILE_PATHS)
import nox FILE_PATHS = ["utils", "main.py"] @nox.session def format(session): session.install("black") session.run("black", *FILE_PATHS)
none
1
1.448321
1
discordbot/economy/currencies.py
minhhoang1023/GamestonkTerminal
1
3941
import os import df2img import disnake import pandas as pd from PIL import Image import discordbot.config_discordbot as cfg from discordbot.config_discordbot import logger from discordbot.helpers import autocrop_image from gamestonk_terminal.economy import wsj_model async def currencies_command(ctx): """Currenc...
import os import df2img import disnake import pandas as pd from PIL import Image import discordbot.config_discordbot as cfg from discordbot.config_discordbot import logger from discordbot.helpers import autocrop_image from gamestonk_terminal.economy import wsj_model async def currencies_command(ctx): """Currenc...
en
0.308576
Currencies overview [Wall St. Journal] # Debug user input # Retrieve data # Check for argument # pylint: disable=W0640 # Debug user output
2.667741
3
aiovectortiler/config_handler.py
shongololo/aiovectortiler
4
3942
<filename>aiovectortiler/config_handler.py<gh_stars>1-10 import os import yaml import logging logger = logging.getLogger(__name__) class Configs: server = None recipes = {} DB = None plugins = None @classmethod def init_server_configs(cls, server_configs): with open(server_configs) a...
<filename>aiovectortiler/config_handler.py<gh_stars>1-10 import os import yaml import logging logger = logging.getLogger(__name__) class Configs: server = None recipes = {} DB = None plugins = None @classmethod def init_server_configs(cls, server_configs): with open(server_configs) a...
en
0.509479
# for windows # add the recipe name based on the file name # this is needed by the tilejson query Plugins.load() Plugins.hook('before_load', config=Configs) def load_recipe(data): name = data.get('name', 'default') if name in RECIPES: raise ValueError('Recipe with name {} already exist'.format(name)) ...
2.366797
2
volksdep/converters/__init__.py
repoww/volksdep
271
3943
from .torch2onnx import torch2onnx from .onnx2trt import onnx2trt from .torch2trt import torch2trt from .base import load, save
from .torch2onnx import torch2onnx from .onnx2trt import onnx2trt from .torch2trt import torch2trt from .base import load, save
none
1
1.161642
1
t2vretrieval/models/mlmatch.py
Roc-Ng/HANet
34
3944
<reponame>Roc-Ng/HANet<gh_stars>10-100 import numpy as np import torch import framework.ops import t2vretrieval.encoders.mlsent import t2vretrieval.encoders.mlvideo import t2vretrieval.models.globalmatch from t2vretrieval.models.criterion import cosine_sim from t2vretrieval.models.globalmatch import VISENC, TXTENC c...
import numpy as np import torch import framework.ops import t2vretrieval.encoders.mlsent import t2vretrieval.encoders.mlvideo import t2vretrieval.models.globalmatch from t2vretrieval.models.criterion import cosine_sim from t2vretrieval.models.globalmatch import VISENC, TXTENC class RoleGraphMatchModelConfig(t2vretri...
en
0.591478
# sim, embed ## this config will be covered by model.json due to the functions of load and load_from_dict # (batch, max_vis_len, dim_embed) ## sentence ## length ## batch*nv*max_sen_len ## batch*(n_v+n_n) ## batch*(1+n_v+n_n)*(1+n_v+n_n) # sent_embeds: (batch, dim_embed) # verb_embeds, noun_embeds: (batch, num_xxx, dim...
2.030688
2
bench_fastapi/authentication/controllers/login.py
sharkguto/teste_carga
1
3945
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # # login.py # @Author : <NAME> (<EMAIL>) # @Link : # @Date : 12/12/2019, 11:43:07 AM from typing import Optional, Any from fastapi import APIRouter, Body, Depends, HTTPException from fastapi import Header, Security from authentication.models.users import...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # login.py # @Author : <NAME> (<EMAIL>) # @Link : # @Date : 12/12/2019, 11:43:07 AM from typing import Optional, Any from fastapi import APIRouter, Body, Depends, HTTPException from fastapi import Header, Security from authentication.models.users import User from fast...
en
0.463946
#!/usr/bin/env python # -*- coding: utf-8 -*- # # login.py # @Author : <NAME> (<EMAIL>) # @Link : # @Date : 12/12/2019, 11:43:07 AM UPDATE users.tbl_users SET token = :token WHERE id = :id # @router.post("/login", dependencies=[Depends(verify_token)]) # async def renew_token(x_api_key: str = Header(None))...
2.462642
2
dronesym-python/flask-api/src/dronepool.py
dilinade/DroneSym
1
3946
<reponame>dilinade/DroneSym<filename>dronesym-python/flask-api/src/dronepool.py #DronePool module which handles interaction with SITLs from dronekit import Vehicle, VehicleMode, connect from dronekit_sitl import SITL from threading import Lock import node, time import mavparser import threadrunner drone_pool = {} ins...
#DronePool module which handles interaction with SITLs from dronekit import Vehicle, VehicleMode, connect from dronekit_sitl import SITL from threading import Lock import node, time import mavparser import threadrunner drone_pool = {} instance_count = 0 env_test = False q = None mq = None lock = Lock() class Sim(SI...
en
0.767754
#DronePool module which handles interaction with SITLs # print "df: " + `diff` # print next_wp
2.594724
3
Problemset/longest-string-chain/longest-string-chain.py
KivenCkl/LeetCode
7
3947
# @Title: 最长字符串链 (Longest String Chain) # @Author: KivenC # @Date: 2019-05-26 20:35:25 # @Runtime: 144 ms # @Memory: 13.3 MB class Solution: # # way 1 # def longestStrChain(self, words: List[str]) -> int: # # 动态规划 # # dp[i] = max(dp[i], dp[j] + 1) (0 <= j < i 且 words[j] 是 words[i] 的前身) # ...
# @Title: 最长字符串链 (Longest String Chain) # @Author: KivenC # @Date: 2019-05-26 20:35:25 # @Runtime: 144 ms # @Memory: 13.3 MB class Solution: # # way 1 # def longestStrChain(self, words: List[str]) -> int: # # 动态规划 # # dp[i] = max(dp[i], dp[j] + 1) (0 <= j < i 且 words[j] 是 words[i] 的前身) # ...
en
0.430524
# @Title: 最长字符串链 (Longest String Chain) # @Author: KivenC # @Date: 2019-05-26 20:35:25 # @Runtime: 144 ms # @Memory: 13.3 MB # # way 1 # def longestStrChain(self, words: List[str]) -> int: # # 动态规划 # # dp[i] = max(dp[i], dp[j] + 1) (0 <= j < i 且 words[j] 是 words[i] 的前身) # length = len(w...
3.385578
3
IKFK Builder/IKFK_Builder.py
ssimbox/ssimbox-rigTools
1
3948
<reponame>ssimbox/ssimbox-rigTools from ctrlUI_lib import createClav2, createSphere import maya.cmds as cmds import maya.OpenMaya as om from functools import partial def duplicateChain(*args): global ogChain global chainLen global switcherLoc global side global controllerColor global clavC...
from ctrlUI_lib import createClav2, createSphere import maya.cmds as cmds import maya.OpenMaya as om from functools import partial def duplicateChain(*args): global ogChain global chainLen global switcherLoc global side global controllerColor global clavCheckbox global rigGrp, ctrlGrp ...
en
0.739947
# Initialize input from UI #this is totally unscalable but for now it's ok #suffix for the new chains #create a joint, copy their position and freeze transform #deselect to make the two different hierarchies # Create a locator used for switching IK/FK mode and snap it between two joints #yellow #IMPROVE THIS SHIT #remo...
2.316453
2
pipng/imagescale-q-m.py
nwiizo/joke
1
3949
<filename>pipng/imagescale-q-m.py #!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of t...
<filename>pipng/imagescale-q-m.py #!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of t...
en
0.873244
#!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any ...
2.317763
2
test/integration_test.py
NoopDog/azul
0
3950
<filename>test/integration_test.py from abc import ( ABCMeta, ) from concurrent.futures.thread import ( ThreadPoolExecutor, ) from contextlib import ( contextmanager, ) import csv from functools import ( lru_cache, ) import gzip from io import ( BytesIO, TextIOWrapper, ) import json import loggi...
<filename>test/integration_test.py from abc import ( ABCMeta, ) from concurrent.futures.thread import ( ThreadPoolExecutor, ) from contextlib import ( contextmanager, ) import csv from functools import ( lru_cache, ) import gzip from io import ( BytesIO, TextIOWrapper, ) import json import loggi...
en
0.872662
# noinspection PyPep8Naming # Index some bundles again to test that we handle duplicate additions. # Note: random.choices() may pick the same element multiple times so # some notifications will end up being sent three or more times. # For faster modify-deploy-test cycles, set `delete` to False and run # test once. Then...
1.758183
2
server/openapi_server/controllers/data_transformation_controller.py
mintproject/MINT-ModelCatalogIngestionAPI
2
3951
import connexion import six from openapi_server import query_manager from openapi_server.utils.vars import DATATRANSFORMATION_TYPE_NAME, DATATRANSFORMATION_TYPE_URI from openapi_server.models.data_transformation import DataTransformation # noqa: E501 from openapi_server import util def custom_datasetspecifications_i...
import connexion import six from openapi_server import query_manager from openapi_server.utils.vars import DATATRANSFORMATION_TYPE_NAME, DATATRANSFORMATION_TYPE_URI from openapi_server.models.data_transformation import DataTransformation # noqa: E501 from openapi_server import util def custom_datasetspecifications_i...
en
0.627248
# noqa: E501 # noqa: E501 Gets a list of data transformations related a dataset Gets a list of data transformations related a dataset # noqa: E501 :param id: The ID of the dataspecification :type id: str :param custom_query_name: Name of the custom query :type custom_query_name: str :param use...
2.148296
2
shap/plots/monitoring.py
NunoEdgarGFlowHub/shap
8
3952
import numpy as np import scipy import warnings try: import matplotlib.pyplot as pl import matplotlib except ImportError: warnings.warn("matplotlib could not be loaded!") pass from . import labels from . import colors def truncate_text(text, max_len): if len(text) > max_len: return text[:i...
import numpy as np import scipy import warnings try: import matplotlib.pyplot as pl import matplotlib except ImportError: warnings.warn("matplotlib could not be loaded!") pass from . import labels from . import colors def truncate_text(text, max_len): if len(text) > max_len: return text[:i...
en
0.689258
Create a SHAP monitoring plot. (Note this function is preliminary and subject to change!!) A SHAP monitoring plot is meant to display the behavior of a model over time. Often the shap_values given to this plot explain the loss of a model, so changes in a feature's impact on the model's loss over ...
3.308963
3
mod_core.py
nokia-wroclaw/innovativeproject-dbshepherd
0
3953
import re import os import cmd import sys import common from getpass import getpass from kp import KeePassError, get_password from configmanager import ConfigManager, ConfigManagerError common.init() class ParseArgsException(Exception): def __init__(self, msg): self.msg = msg class ModuleCore(cmd.Cmd): def __...
import re import os import cmd import sys import common from getpass import getpass from kp import KeePassError, get_password from configmanager import ConfigManager, ConfigManagerError common.init() class ParseArgsException(Exception): def __init__(self, msg): self.msg = msg class ModuleCore(cmd.Cmd): def __...
pl
0.998274
#defaults #Completions #$%^&*()_+-,./<>?]+', string) # wykonuje daną funkcję (callback) na wszystkich bazach # link - file.server.base # wykonaj na wszystkich plikach # pobierz listę plików konfiguracyjnych # wyświetl na czym będziesz wykonywać #wykonaj callback #podaj tylko informację na czym callback zostałby wykonan...
2.474761
2
code/testbed/pde1/FemPde1.py
nicolai-schwartze/Masterthesis
1
3954
# -*- coding: utf-8 -*- """ Created on Mon Apr 13 14:57:32 2020 @author: Nicolai """ import sys import os importpath = os.path.dirname(os.path.realpath(__file__)) + "/../" sys.path.append(importpath) from FemPdeBase import FemPdeBase import numpy as np # import from ngsolve import ngsolve as ngs from netgen.geom2d i...
# -*- coding: utf-8 -*- """ Created on Mon Apr 13 14:57:32 2020 @author: Nicolai """ import sys import os importpath = os.path.dirname(os.path.realpath(__file__)) + "/../" sys.path.append(importpath) from FemPdeBase import FemPdeBase import numpy as np # import from ngsolve import ngsolve as ngs from netgen.geom2d i...
en
0.611651
# -*- coding: utf-8 -*- Created on Mon Apr 13 14:57:32 2020 @author: Nicolai # import from ngsolve **Implementation of PDE1 of the testbed:** .. math:: - \Delta u(\mathbf{x}) = -2^{40}y^{10}(1-y)^{10}[90x^8(1-x)^{10} - 200x^9(1-x)^9 + 90x^{10}(1-x)^8] -2^{40}x...
2.577753
3
cvxpy/cvxcore/tests/python/364A_scripts/power_lines.py
jasondark/cvxpy
38
3955
<reponame>jasondark/cvxpy<filename>cvxpy/cvxcore/tests/python/364A_scripts/power_lines.py import numpy as np from cvxpy import * import copy import time # data for power flow problem import numpy as np n = 12 # total number of nodes m = 18 # number of edges (transmission lines) k = 4 # number of generator...
import numpy as np from cvxpy import * import copy import time # data for power flow problem import numpy as np n = 12 # total number of nodes m = 18 # number of edges (transmission lines) k = 4 # number of generators # transmission line capacities = TIME = 0 Pmax = np.matrix(""" 4.8005, 1.9246,...
en
0.515083
# data for power flow problem # total number of nodes # number of edges (transmission lines) # number of generators # transmission line capacities = 4.8005, 1.9246, 3.4274, 2.9439, 4.5652, 4.0484, 2.8259, 1.0740, 4.2856, 2.7788, 3.4617, 4.1677, 4.6873, 3.9528, 1.7...
2.483207
2
LeetCode/530 Minimum Absolute Difference in BST.py
gesuwen/Algorithms
0
3956
# Binary Search Tree # Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. # # Example: # # Input: # # 1 # \ # 3 # / # 2 # # Output: # 1 # # Explanation: # The minimum absolute difference is 1, which is the difference between 2 a...
# Binary Search Tree # Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. # # Example: # # Input: # # 1 # \ # 3 # / # 2 # # Output: # 1 # # Explanation: # The minimum absolute difference is 1, which is the difference between 2 a...
en
0.794612
# Binary Search Tree # Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. # # Example: # # Input: # # 1 # \ # 3 # / # 2 # # Output: # 1 # # Explanation: # The minimum absolute difference is 1, which is the difference between 2 an...
4.303164
4
backends/search/__init__.py
dev-easyshares/company
0
3957
<gh_stars>0 from company.choices import fr as choices from mighty.errors import BackendError import datetime, logging logger = logging.getLogger(__name__) CHOICES_APE = dict(choices.APE) CHOICES_LEGALFORM = dict(choices.LEGALFORM) CHOICES_SLICE = dict(choices.SLICE_EFFECTIVE) class SearchBackend: message = None ...
from company.choices import fr as choices from mighty.errors import BackendError import datetime, logging logger = logging.getLogger(__name__) CHOICES_APE = dict(choices.APE) CHOICES_LEGALFORM = dict(choices.LEGALFORM) CHOICES_SLICE = dict(choices.SLICE_EFFECTIVE) class SearchBackend: message = None since_for...
none
1
2.405628
2
app/database/database.py
luisornelasch/melp
0
3958
<reponame>luisornelasch/melp from sqlalchemy import create_engine, engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker import os SQLALCHEMY_DATABASE_URL = os.getenv("DATABASE_URL").replace("postgres://", "postgresql+psycopg2://") engine = create_engine(SQLALCHEMY_DAT...
from sqlalchemy import create_engine, engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker import os SQLALCHEMY_DATABASE_URL = os.getenv("DATABASE_URL").replace("postgres://", "postgresql+psycopg2://") engine = create_engine(SQLALCHEMY_DATABASE_URL) SessionLocal = se...
none
1
2.52666
3
ragweed/framework.py
soumyakoduri/ragweed
0
3959
<gh_stars>0 import sys import os import boto import boto.s3.connection import json import inspect import pickle import bunch import yaml import ConfigParser import rados from boto.s3.key import Key from nose.plugins.attrib import attr from nose.tools import eq_ as eq from .reqs import _make_admin_request ragweed_env ...
import sys import os import boto import boto.s3.connection import json import inspect import pickle import bunch import yaml import ConfigParser import rados from boto.s3.key import Key from nose.plugins.attrib import attr from nose.tools import eq_ as eq from .reqs import _make_admin_request ragweed_env = None suite...
en
0.550898
# old style explicit pool # new style explicit pool # new style # old style
1.883048
2
exposing/_version.py
w4k2/exposing
0
3960
<filename>exposing/_version.py """ ``exposing`` """ __version__ = '0.2.2'
<filename>exposing/_version.py """ ``exposing`` """ __version__ = '0.2.2'
it
0.12572
``exposing``
1.162433
1
opensteer/teams/admin.py
reckonsys/opensteer
5
3961
<filename>opensteer/teams/admin.py from django.contrib import admin from opensteer.teams.models import Team, Member admin.site.register(Team) admin.site.register(Member)
<filename>opensteer/teams/admin.py from django.contrib import admin from opensteer.teams.models import Team, Member admin.site.register(Team) admin.site.register(Member)
none
1
1.516384
2
tests/test_utils.py
ozora-ogino/tflite-human-tracking
3
3962
<gh_stars>1-10 from src.utils import check_direction, direction_config, is_intersect # pylint:disable=unexpected-keyword-arg class TestCheckDirection: def test_true(self): """Test true case.""" directions = { "right": {"prev_center": [0, 0], "current_center": [20, 0], "expect": True},...
from src.utils import check_direction, direction_config, is_intersect # pylint:disable=unexpected-keyword-arg class TestCheckDirection: def test_true(self): """Test true case.""" directions = { "right": {"prev_center": [0, 0], "current_center": [20, 0], "expect": True}, "l...
en
0.696326
# pylint:disable=unexpected-keyword-arg Test true case. Test false case. # This is right. # This is bottom. # This is top. Check if always return true when direction is set None. # No movement. # Right # Left. # Top. # Bottom. # If the direction is None, always return True. Test true case. Test false case.
2.899424
3
scpp_base/scpp_base/src/db/__init__.py
scorelab/social-currency
4
3963
_all__ = ["db_handler","coin_value_handler"]
_all__ = ["db_handler","coin_value_handler"]
none
1
1.008597
1
test/test_parameter_set.py
crest-cassia/caravan_search_engine
0
3964
<reponame>crest-cassia/caravan_search_engine import unittest from caravan.tables import Tables from caravan.parameter_set import ParameterSet class ParameterSetTest(unittest.TestCase): def setUp(self): self.t = Tables.get() self.t.clear() def test_ps(self): ps = ParameterSet(500, (2, ...
import unittest from caravan.tables import Tables from caravan.parameter_set import ParameterSet class ParameterSetTest(unittest.TestCase): def setUp(self): self.t = Tables.get() self.t.clear() def test_ps(self): ps = ParameterSet(500, (2, 3, 4, 5)) self.assertEqual(ps.id, 500...
none
1
2.620054
3
tests/unit/transport/s3/test_settings.py
TinkoffCreditSystems/overhave
33
3965
import pytest from pydantic import ValidationError from overhave.transport import OverhaveS3ManagerSettings class TestS3ManagerSettings: """ Unit tests for :class:`OverhaveS3ManagerSettings`. """ @pytest.mark.parametrize("test_s3_enabled", [False]) def test_disabled(self, test_s3_enabled: bool) -> None:...
import pytest from pydantic import ValidationError from overhave.transport import OverhaveS3ManagerSettings class TestS3ManagerSettings: """ Unit tests for :class:`OverhaveS3ManagerSettings`. """ @pytest.mark.parametrize("test_s3_enabled", [False]) def test_disabled(self, test_s3_enabled: bool) -> None:...
en
0.35413
Unit tests for :class:`OverhaveS3ManagerSettings`.
2.352371
2
examples/elCmd.py
mark-nicholson/python-editline
4
3966
<reponame>mark-nicholson/python-editline """A generic class to build line-oriented command interpreters. Interpreters constructed with this class obey the following conventions: 1. End of file on input is processed as the command 'EOF'. 2. A command is parsed out of each line by collecting the prefix composed of c...
"""A generic class to build line-oriented command interpreters. Interpreters constructed with this class obey the following conventions: 1. End of file on input is processed as the command 'EOF'. 2. A command is parsed out of each line by collecting the prefix composed of characters in the identchars member. 3. A ...
en
0.864055
A generic class to build line-oriented command interpreters. Interpreters constructed with this class obey the following conventions: 1. End of file on input is processed as the command 'EOF'. 2. A command is parsed out of each line by collecting the prefix composed of characters in the identchars member. 3. A com...
2.651222
3
ecommerce-website/orders/admin.py
Shanu85/FCS_Project
0
3967
<reponame>Shanu85/FCS_Project from django.contrib import admin from .models import Order, receiverInfo @admin.register(Order) class OrderAdmin(admin.ModelAdmin): date_hierarchy = 'created_at' list_display = ('user', 'code', 'total_price', 'shipping_status', 'created_at') list_display_links = ('user',) ...
from django.contrib import admin from .models import Order, receiverInfo @admin.register(Order) class OrderAdmin(admin.ModelAdmin): date_hierarchy = 'created_at' list_display = ('user', 'code', 'total_price', 'shipping_status', 'created_at') list_display_links = ('user',) list_editable = ('shipping_s...
none
1
2.035579
2
data_structures/linked_lists/ll-kth-from-end/ll_kth.py
jeremyCtown/data-structures-and-algorithms
0
3968
<gh_stars>0 from node import Node class LinkedList: """ initializes LL """ def __init__(self, iter=[]): self.head = None self._size = 0 for item in reversed(iter): self.insert(item) def __repr__(self): """ assumes head will have a val and we wi...
from node import Node class LinkedList: """ initializes LL """ def __init__(self, iter=[]): self.head = None self._size = 0 for item in reversed(iter): self.insert(item) def __repr__(self): """ assumes head will have a val and we will need this...
en
0.867482
initializes LL assumes head will have a val and we will need this this is where we can see the list returns size of LL basic insertion method for adding to front of LL appends node to the end of the LL inserts node before node at val inserts node after node at val returns node at kth from end
4.04396
4
MuonAnalysis/MomentumScaleCalibration/test/LikelihoodPdfDBReader_cfg.py
ckamtsikis/cmssw
852
3969
import FWCore.ParameterSet.Config as cms process = cms.Process("LIKELIHOODPDFDBREADER") # process.load("MuonAnalysis.MomentumScaleCalibration.local_CSA08_Y_cff") process.source = cms.Source("EmptySource", numberEventsInRun = cms.untracked.uint32(1), firstRun = cms.untracked.uint32(1) ) process.load("Configur...
import FWCore.ParameterSet.Config as cms process = cms.Process("LIKELIHOODPDFDBREADER") # process.load("MuonAnalysis.MomentumScaleCalibration.local_CSA08_Y_cff") process.source = cms.Source("EmptySource", numberEventsInRun = cms.untracked.uint32(1), firstRun = cms.untracked.uint32(1) ) process.load("Configur...
en
0.311038
# process.load("MuonAnalysis.MomentumScaleCalibration.local_CSA08_Y_cff") # process.source = cms.Source("PoolSource", # fileNames = cms.untracked.vstring() # )
1.321428
1
fast_fine_tuna/fast_fine_tuna.py
vinid/fast_fine_tuna
0
3970
<reponame>vinid/fast_fine_tuna from transformers import AutoModel, AutoModelForSequenceClassification, AutoTokenizer, AutoConfig from sklearn.model_selection import StratifiedKFold import numpy as np import torch from fast_fine_tuna.dataset import MainDatasetDouble, MainDataset from transformers import AdamW from torch...
from transformers import AutoModel, AutoModelForSequenceClassification, AutoTokenizer, AutoConfig from sklearn.model_selection import StratifiedKFold import numpy as np import torch from fast_fine_tuna.dataset import MainDatasetDouble, MainDataset from transformers import AdamW from torch.utils.data import DataLoader i...
en
0.881395
# not the smartest way to do this, but faster to code up # not the smartest way to do this, but faster to code up
2.239526
2
Message/Message.py
gauravyeole/KVstoreDB
1
3971
<filename>Message/Message.py # Message class Implementation # @author: <NAME> <<EMAIL>> class Message: class Request: def __init__(self, action="", data=None): self.action = action self.data = data class Rsponse: def __init__(self): self.status = False ...
<filename>Message/Message.py # Message class Implementation # @author: <NAME> <<EMAIL>> class Message: class Request: def __init__(self, action="", data=None): self.action = action self.data = data class Rsponse: def __init__(self): self.status = False ...
en
0.202592
# Message class Implementation # @author: <NAME> <<EMAIL>>
2.962778
3
wpt/websockets/websock_handlers/open_delay_wsh.py
gsnedders/presto-testo
0
3972
#!/usr/bin/python from mod_pywebsocket import msgutil import time def web_socket_do_extra_handshake(request): pass # Always accept. def web_socket_transfer_data(request): time.sleep(3) msgutil.send_message(request, "line")
#!/usr/bin/python from mod_pywebsocket import msgutil import time def web_socket_do_extra_handshake(request): pass # Always accept. def web_socket_transfer_data(request): time.sleep(3) msgutil.send_message(request, "line")
en
0.395454
#!/usr/bin/python # Always accept.
2.04519
2
airflow/providers/microsoft/psrp/operators/psrp.py
augusto-herrmann/airflow
4
3973
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
en
0.820945
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
1.846617
2
appengine/monorail/services/api_pb2_v1_helpers.py
mithro/chromium-infra
1
3974
<gh_stars>1-10 # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is govered by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd """Convert Monorail PB objects to API PB objects""" import datetime import loggi...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is govered by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd """Convert Monorail PB objects to API PB objects""" import datetime import logging import time ...
en
0.748213
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is govered by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd Convert Monorail PB objects to API PB objects Convert Monorail Project PB to API ProjectWrapper P...
1.830771
2
excut/feedback/rulebased_deduction/deduction_engine_extended.py
mhmgad/ExCut
5
3975
""" This module contains the rule-based inference (rulebased_deduction engine) """ import itertools from collections import defaultdict from itertools import chain from excut.explanations_mining.descriptions import dump_explanations_to_file from excut.explanations_mining.descriptions_new import Description2, Atom, loa...
""" This module contains the rule-based inference (rulebased_deduction engine) """ import itertools from collections import defaultdict from itertools import chain from excut.explanations_mining.descriptions import dump_explanations_to_file from excut.explanations_mining.descriptions_new import Description2, Atom, loa...
en
0.74354
This module contains the rule-based inference (rulebased_deduction engine) An object to represent the prediction of the rules :ivar triple: the predicted triple :ivar all_sources: all rules that predicted the same triple # def __init__(self, triple: tuple, source_description=Description(), all_sources=None): #...
2.227304
2
dataloader/viperlist_train.py
urasakikeisuke/rigidmask
138
3976
<reponame>urasakikeisuke/rigidmask<gh_stars>100-1000 import torch.utils.data as data from PIL import Image import os import os.path import numpy as np import pdb import glob IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', ] def is_image_file(filename): ...
import torch.utils.data as data from PIL import Image import os import os.path import numpy as np import pdb import glob IMG_EXTENSIONS = [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', ] def is_image_file(filename): return any(filename.endswith(extension) for extensi...
none
1
2.599331
3
floodcomparison/__init__.py
jsosa/floodcomparison
0
3977
<filename>floodcomparison/__init__.py from floodcomparison.core import floodcomparison
<filename>floodcomparison/__init__.py from floodcomparison.core import floodcomparison
none
1
1.194878
1
weaver/wps_restapi/quotation/quotes.py
crim-ca/weaver
16
3978
import logging import random from datetime import timedelta from typing import TYPE_CHECKING from duration import to_iso8601 from pyramid.httpexceptions import HTTPBadRequest, HTTPCreated, HTTPNotFound, HTTPOk from weaver import sort from weaver.config import WEAVER_CONFIGURATION_ADES, WEAVER_CONFIGURATION_EMS, get_w...
import logging import random from datetime import timedelta from typing import TYPE_CHECKING from duration import to_iso8601 from pyramid.httpexceptions import HTTPBadRequest, HTTPCreated, HTTPNotFound, HTTPOk from weaver import sort from weaver.config import WEAVER_CONFIGURATION_ADES, WEAVER_CONFIGURATION_EMS, get_w...
en
0.709917
# noqa: E811 # type: (Process) -> JSON Simulate quote parameters for the process execution. :param process: instance of :class:`weaver.datatype.Process` for which to evaluate the quote. :return: dict of {price, currency, estimatedTime} values for the process quote. # TODO: replace by some fancy ml technique or...
2.017143
2
strava.py
AartGoossens/streamlit-activity-viewer
4
3979
<reponame>AartGoossens/streamlit-activity-viewer import base64 import os import arrow import httpx import streamlit as st import sweat from bokeh.models.widgets import Div APP_URL = os.environ["APP_URL"] STRAVA_CLIENT_ID = os.environ["STRAVA_CLIENT_ID"] STRAVA_CLIENT_SECRET = os.environ["STRAVA_CLIENT_SECRET"] STRAV...
import base64 import os import arrow import httpx import streamlit as st import sweat from bokeh.models.widgets import Div APP_URL = os.environ["APP_URL"] STRAVA_CLIENT_ID = os.environ["STRAVA_CLIENT_ID"] STRAVA_CLIENT_SECRET = os.environ["STRAVA_CLIENT_SECRET"] STRAVA_AUTHORIZATION_URL = "https://www.strava.com/oau...
none
1
2.838173
3
appliance/src/ufw_interface.py
reap3r/nmfta-bouncer
1
3980
<filename>appliance/src/ufw_interface.py #!/usr/bin/env python #shamelessy stolen from: https://gitlab.com/dhj/easyufw # A thin wrapper over the thin wrapper that is ufw # Usage: # import easyufw as ufw # ufw.disable() # disable firewall # ufw.enable() # enable firewall # ufw.allow() #...
<filename>appliance/src/ufw_interface.py #!/usr/bin/env python #shamelessy stolen from: https://gitlab.com/dhj/easyufw # A thin wrapper over the thin wrapper that is ufw # Usage: # import easyufw as ufw # ufw.disable() # disable firewall # ufw.enable() # enable firewall # ufw.allow() #...
en
0.520133
#!/usr/bin/env python #shamelessy stolen from: https://gitlab.com/dhj/easyufw # A thin wrapper over the thin wrapper that is ufw # Usage: # import easyufw as ufw # ufw.disable() # disable firewall # ufw.enable() # enable firewall # ufw.allow() # default allow -- allow all # ufw.allow(2...
2.069425
2
test/libsalt/test_vehicle.py
etri-city-traffic-brain/traffic-simulator
8
3981
<reponame>etri-city-traffic-brain/traffic-simulator import libsalt def test(salt_scenario): libsalt.start(salt_scenario) libsalt.setCurrentStep(25200) step = libsalt.getCurrentStep() while step <= 36000: if (step % 100 == 0): print("Simulation Step: ", step) test_funcs(...
import libsalt def test(salt_scenario): libsalt.start(salt_scenario) libsalt.setCurrentStep(25200) step = libsalt.getCurrentStep() while step <= 36000: if (step % 100 == 0): print("Simulation Step: ", step) test_funcs() libsalt.simulationStep() step = li...
en
0.614837
#for vehicle in runnings: # print("\t", vehicle.toString()) #for vehicle in standbys: # print("\t", vehicle.toString()) # for vehicle in runnings: # print("Running Vehicle)", vehicle.id, ":", libsalt.vehicle.getRoute(vehicle.id).toString()) # print("Running Vehicle)", vehicle.id, ":", vehicle.toString()...
2.326862
2
Masters/Copy Layer to Layer.py
davidtahim/Glyphs-Scripts
1
3982
#MenuTitle: Copy Layer to Layer # -*- coding: utf-8 -*- __doc__=""" Copies one master to another master in selected glyphs. """ import GlyphsApp import vanilla import math def getComponentScaleX_scaleY_rotation( self ): a = self.transform[0] b = self.transform[1] c = self.transform[2] d = self.transform[3] ...
#MenuTitle: Copy Layer to Layer # -*- coding: utf-8 -*- __doc__=""" Copies one master to another master in selected glyphs. """ import GlyphsApp import vanilla import math def getComponentScaleX_scaleY_rotation( self ): a = self.transform[0] b = self.transform[1] c = self.transform[2] d = self.transform[3] ...
en
0.753809
#MenuTitle: Copy Layer to Layer # -*- coding: utf-8 -*- Copies one master to another master in selected glyphs. # Window 'self.w': # user can resize width by this value # user can resize height by this value # default window size # window title # minimum size (for resizing) # maximum size (for resizing) # stores last w...
2.598231
3
vunit/test/unit/test_tokenizer.py
bjacobs1/vunit
1
3983
<reponame>bjacobs1/vunit # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2014-2018, <NAME> <EMAIL> """ Test of the general tokenizer """ from unittes...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2014-2018, <NAME> <EMAIL> """ Test of the general tokenizer """ from unittest import TestCase from vu...
en
0.847544
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2014-2018, <NAME> <EMAIL> Test of the general tokenizer Test of the general tokenizer \ S \ at filename...
2.53057
3
modules/star_se_SP.py
tbersez/Allmine
5
3984
<filename>modules/star_se_SP.py # STAR aligner single end mode, second pass # # This module runs the second pass of the STAR aligner 2 path # strategy. The goal is to align reads taking in account splice # junction found in the fist pass.. # # Inputs: # - sample_trim.fastq.gz # - splicing junction f...
<filename>modules/star_se_SP.py # STAR aligner single end mode, second pass # # This module runs the second pass of the STAR aligner 2 path # strategy. The goal is to align reads taking in account splice # junction found in the fist pass.. # # Inputs: # - sample_trim.fastq.gz # - splicing junction f...
en
0.321539
# STAR aligner single end mode, second pass # # This module runs the second pass of the STAR aligner 2 path # strategy. The goal is to align reads taking in account splice # junction found in the fist pass.. # # Inputs: # - sample_trim.fastq.gz # - splicing junction files (.tab) # # Output: # ...
2.36976
2
Udemy/REST-Django-VueJS/C3-practice/03-demo/job_board/jobs/models.py
runzezhang/MOOCs
3
3985
from django.db import models class JobOffer(models.Model): company_name = models.CharField(max_length=50) company_email = models.EmailField() job_title = models.CharField(max_length=60) job_description = models.TextField() salary = models.PositiveIntegerField() city = models.CharField(max_leng...
from django.db import models class JobOffer(models.Model): company_name = models.CharField(max_length=50) company_email = models.EmailField() job_title = models.CharField(max_length=60) job_description = models.TextField() salary = models.PositiveIntegerField() city = models.CharField(max_leng...
none
1
2.294521
2
memeapp/views.py
barbaramootian/Memes-app
0
3986
from django.shortcuts import render,redirect from django.contrib.auth.models import User from django.contrib import messages from .forms import PictureUploadForm,CommentForm from .models import Image,Profile,Likes,Comments from django.contrib.auth.decorators import login_required from django.contrib .auth import authen...
from django.shortcuts import render,redirect from django.contrib.auth.models import User from django.contrib import messages from .forms import PictureUploadForm,CommentForm from .models import Image,Profile,Likes,Comments from django.contrib.auth.decorators import login_required from django.contrib .auth import authen...
none
1
2.134915
2
sparv/modules/hist/diapivot.py
spraakbanken/sparv-pipeline
17
3987
"""Create diapivot annotation.""" import logging import pickle import xml.etree.ElementTree as etree import sparv.util as util from sparv import Annotation, Model, ModelOutput, Output, annotator, modelbuilder log = logging.getLogger(__name__) PART_DELIM1 = "^1" # @annotator("Diapivot annotation", language=["swe-1...
"""Create diapivot annotation.""" import logging import pickle import xml.etree.ElementTree as etree import sparv.util as util from sparv import Annotation, Model, ModelOutput, Output, annotator, modelbuilder log = logging.getLogger(__name__) PART_DELIM1 = "^1" # @annotator("Diapivot annotation", language=["swe-1...
en
0.514752
Create diapivot annotation. # @annotator("Diapivot annotation", language=["swe-1800"]) Annotate each lemgram with its corresponding saldo_id according to model. Args: out (str, optional): Resulting annotation file. Defaults to Output("<token>:hist.diapivot", description="SALDO IDs corresponding...
2.54157
3
src/xbot/util/path.py
xinyang178/xbot
77
3988
import os def get_root_path(): current_path = os.path.abspath(os.path.dirname(__file__)) root_path = os.path.dirname( os.path.dirname(os.path.dirname(os.path.dirname(current_path))) ) return os.path.join(root_path, "xbot") def get_config_path(): config_path = os.path.abspath(os.path.join...
import os def get_root_path(): current_path = os.path.abspath(os.path.dirname(__file__)) root_path = os.path.dirname( os.path.dirname(os.path.dirname(os.path.dirname(current_path))) ) return os.path.join(root_path, "xbot") def get_config_path(): config_path = os.path.abspath(os.path.join...
none
1
3.022295
3
home/website/wagtail_hooks.py
HackSoftware/hackconf.bg
12
3989
from django.utils.html import format_html from wagtail.wagtailcore import hooks @hooks.register('insert_editor_js') def enable_source(): return format_html( """ <script> registerHalloPlugin('hallohtml'); </script> """ )
from django.utils.html import format_html from wagtail.wagtailcore import hooks @hooks.register('insert_editor_js') def enable_source(): return format_html( """ <script> registerHalloPlugin('hallohtml'); </script> """ )
en
0.113895
<script> registerHalloPlugin('hallohtml'); </script>
1.582885
2
src/reporter/tests/test_api.py
msgis/ngsi-timeseries-api
0
3990
from conftest import QL_URL import requests def test_api(): api_url = "{}/".format(QL_URL) r = requests.get('{}'.format(api_url)) assert r.status_code == 200, r.text assert r.json() == { "notify_url": "/v2/notify", "subscriptions_url": "/v2/subscriptions", "entities_...
from conftest import QL_URL import requests def test_api(): api_url = "{}/".format(QL_URL) r = requests.get('{}'.format(api_url)) assert r.status_code == 200, r.text assert r.json() == { "notify_url": "/v2/notify", "subscriptions_url": "/v2/subscriptions", "entities_...
none
1
2.673314
3
zorg/buildbot/conditions/FileConditions.py
dyung/llvm-zorg
27
3991
from buildbot.process.remotecommand import RemoteCommand from buildbot.interfaces import WorkerTooOldError import stat class FileExists(object): """I check a file existence on the worker. I return True if the file with the given name exists, False if the file does not exist or that is a directory. Us...
from buildbot.process.remotecommand import RemoteCommand from buildbot.interfaces import WorkerTooOldError import stat class FileExists(object): """I check a file existence on the worker. I return True if the file with the given name exists, False if the file does not exist or that is a directory. Us...
en
0.804205
I check a file existence on the worker. I return True if the file with the given name exists, False if the file does not exist or that is a directory. Use me with doStepIf to make a build step conditional to existence of some file. For example doStepIf=FileExists('build/configure') # True only if ...
2.899154
3
gym_combat/gym_combat/envs/main.py
refaev/combat_gym
0
3992
<filename>gym_combat/gym_combat/envs/main.py from matplotlib import style from tqdm import tqdm style.use("ggplot") from gym_combat.envs.Arena.CState import State from gym_combat.envs.Arena.Entity import Entity from gym_combat.envs.Arena.Environment import Environment, Episode from gym_combat.envs.Common.constants imp...
<filename>gym_combat/gym_combat/envs/main.py from matplotlib import style from tqdm import tqdm style.use("ggplot") from gym_combat.envs.Arena.CState import State from gym_combat.envs.Arena.Entity import Entity from gym_combat.envs.Arena.Environment import Environment, Episode from gym_combat.envs.Common.constants imp...
en
0.568058
#if episode_number % EVALUATE_PLAYERS_EVERY == 0: #blue_decision_maker = DQNAgent_keras.DQNAgent_keras(UPDATE_CONTEXT=True, path_model_to_load='conv1(6_6_1_256)_conv2(4_4_256_128)_conv3(3_3_128_128)_flatten_fc__blue_202001_ 0.95max_ -0.04avg_ -3.10min__1620558885.model') ### Red Decision Maker # set new start posit...
2.275102
2
libqif/core/hyper.py
ramongonze/libqif
2
3993
"""Hyper-distributions.""" from libqif.core.secrets import Secrets from libqif.core.channel import Channel from numpy import array, arange, zeros from numpy import delete as npdelete class Hyper: def __init__(self, channel): """Hyper-distribution. To create an instance of this class it is class i...
"""Hyper-distributions.""" from libqif.core.secrets import Secrets from libqif.core.channel import Channel from numpy import array, arange, zeros from numpy import delete as npdelete class Hyper: def __init__(self, channel): """Hyper-distribution. To create an instance of this class it is class i...
en
0.815244
Hyper-distributions. Hyper-distribution. To create an instance of this class it is class it is necessary to have an instance of :py:class:`.Channel` class. Once created an instance of :py:class:`.Hyper`, the constructor generates the joint, outer and inner distributions. Attributes ...
3.277912
3
ansible/venv/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_system_virtual_wan_link.py
gvashchenkolineate/gvashchenkolineate_infra_trytravis
17
3994
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
en
0.682521
#!/usr/bin/python # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is ...
1.66868
2
src/Puerta.py
victorlujan/Dise-odeSoftwarePatrones
0
3995
<filename>src/Puerta.py from ElementoMapa import ElementoMapa class Puerta (ElementoMapa): def __init__(self): self.abierta= True self.lado2=None self.lado1=None def get_abierta(self): return self.abierta def print_cosas(self): print("hola") def set_abierta(self,...
<filename>src/Puerta.py from ElementoMapa import ElementoMapa class Puerta (ElementoMapa): def __init__(self): self.abierta= True self.lado2=None self.lado1=None def get_abierta(self): return self.abierta def print_cosas(self): print("hola") def set_abierta(self,...
none
1
3.164808
3
pong.py
Teenahshe/ponggame
0
3996
""" # Step 1 - Create the App # Step 2 - Create the Game # Step 3 - Build the Game # Step 4 - Run the App """ from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty from kivy.vector import Vector from kivy.clock import C...
""" # Step 1 - Create the App # Step 2 - Create the Game # Step 3 - Build the Game # Step 4 - Run the App """ from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty from kivy.vector import Vector from kivy.clock import C...
en
0.750285
# Step 1 - Create the App # Step 2 - Create the Game # Step 3 - Build the Game # Step 4 - Run the App # Latest Position of the Ball = Current Velocity + Current Position # Update - moving the ball by calling the move function and other stuff # on touch_down() = When our fingers/mouse touches he screen # on touch_up(...
3.983208
4
get_block_data/relation.py
cyclone923/blocks-world
1
3997
class SceneRelation: def __init__(self): self.on_ground = set() self.on_block = {} self.clear = set() def print_relation(self): print(self.on_ground) print(self.on_block) print(self.clear)
class SceneRelation: def __init__(self): self.on_ground = set() self.on_block = {} self.clear = set() def print_relation(self): print(self.on_ground) print(self.on_block) print(self.clear)
none
1
2.444093
2
bridge_RL_agent_v16.py
EricZLou/BridgeRLAgent
0
3998
<filename>bridge_RL_agent_v16.py """ CS 238 Final Project: Bridge RL Agent <NAME> & <NAME> """ import copy import datetime import numpy as np import random from collections import namedtuple """''''''''''''''''''''''''''''''''''''''''''''''''''''''''' REPRESENTATIONS OF BRIDGE Representing a "Card" as an integer: ...
<filename>bridge_RL_agent_v16.py """ CS 238 Final Project: Bridge RL Agent <NAME> & <NAME> """ import copy import datetime import numpy as np import random from collections import namedtuple """''''''''''''''''''''''''''''''''''''''''''''''''''''''''' REPRESENTATIONS OF BRIDGE Representing a "Card" as an integer: ...
en
0.891493
CS 238 Final Project: Bridge RL Agent <NAME> & <NAME> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''' REPRESENTATIONS OF BRIDGE Representing a "Card" as an integer: Cards 0 -> 12 are Club 2 -> Club 14 Cards 13 -> 25 are Diamond 2 -> Diamond 14 Cards 26 -> 38 are Heart 2 -> Heart 14 Cards 39 -> 51...
3.043143
3
tests/hacsbase/test_hacsbase_data.py
chbonkie/hacs
2
3999
"""Data Test Suite.""" from aiogithubapi.objects import repository import pytest import os from homeassistant.core import HomeAssistant from custom_components.hacs.hacsbase.data import HacsData from custom_components.hacs.helpers.classes.repository import HacsRepository from custom_components.hacs.hacsbase.configuratio...
"""Data Test Suite.""" from aiogithubapi.objects import repository import pytest import os from homeassistant.core import HomeAssistant from custom_components.hacs.hacsbase.data import HacsData from custom_components.hacs.helpers.classes.repository import HacsRepository from custom_components.hacs.hacsbase.configuratio...
en
0.273824
Data Test Suite.
1.953902
2