code stringlengths 2k 1.04M | repo_path stringlengths 5 517 | parsed_code stringlengths 0 1.04M | quality_prob float64 0.02 0.95 | learning_prob float64 0.02 0.93 |
|---|---|---|---|---|
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import plotly.graph_objects as go
from pathlib import Path
from matplotlib.axes import Axes
from data.constants import POLLUTANT, YEAR, CITY, CITY_NAME, DATE_NAME
from src.emissions import get_dataframe, mean_per_day, mean_per_month, create_pollu... | airpollpy/study/emissions_study.py | import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import plotly.graph_objects as go
from pathlib import Path
from matplotlib.axes import Axes
from data.constants import POLLUTANT, YEAR, CITY, CITY_NAME, DATE_NAME
from src.emissions import get_dataframe, mean_per_day, mean_per_month, create_pollu... | 0.532668 | 0.350894 |
from pixel_perturbation import *
from misc_functions import *
from saliency import fullgrad
from models.resnet import *
from models.vgg import *
import argparse
# PATH variables
# PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
PATH = os.path.abspath(os.getcwd()) + "/"
dataset = PATH + 'dataset/'
result_path =... | save_all_grad_maps.py | from pixel_perturbation import *
from misc_functions import *
from saliency import fullgrad
from models.resnet import *
from models.vgg import *
import argparse
# PATH variables
# PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
PATH = os.path.abspath(os.getcwd()) + "/"
dataset = PATH + 'dataset/'
result_path =... | 0.525856 | 0.263576 |
import jynx
from jynx.lib.junit import*
from java.lang import Object
from jynx.jannotations import JavaClass, JavaCompiler
sys.classpath.append("/opt/jython2.7.0/jython.jar")
@JavaClass(display=True)
class TestClass(Object):
@Before
def define_classes(self):
self.Foo_code = '''
pub... | jynx/tests/test_jcompile.py | import jynx
from jynx.lib.junit import*
from java.lang import Object
from jynx.jannotations import JavaClass, JavaCompiler
sys.classpath.append("/opt/jython2.7.0/jython.jar")
@JavaClass(display=True)
class TestClass(Object):
@Before
def define_classes(self):
self.Foo_code = '''
pub... | 0.433742 | 0.276372 |
import collections
import plistlib
import sys
import time
from . import common
try:
import subprocess
subprocess.TimeoutExpired
except AttributeError:
import subprocess32
subprocess = subprocess32
__all__ = ['find_all']
def run_diskutil(args):
with open('/dev/null', 'r') as devnull:
ret... | copy2kindle/darwin.py |
import collections
import plistlib
import sys
import time
from . import common
try:
import subprocess
subprocess.TimeoutExpired
except AttributeError:
import subprocess32
subprocess = subprocess32
__all__ = ['find_all']
def run_diskutil(args):
with open('/dev/null', 'r') as devnull:
ret... | 0.294621 | 0.102125 |
import numpy as np
from keras import backend as K
from keras import metrics
from keras.layers import (GRU, Conv1D, Dense, Embedding, Flatten, Input,
Lambda, RepeatVector, TimeDistributed)
from keras.layers.merge import Concatenate, Subtract
from keras.models import Model
from keras.optimizers... | models/material_generator.py | import numpy as np
from keras import backend as K
from keras import metrics
from keras.layers import (GRU, Conv1D, Dense, Embedding, Flatten, Input,
Lambda, RepeatVector, TimeDistributed)
from keras.layers.merge import Concatenate, Subtract
from keras.models import Model
from keras.optimizers... | 0.886905 | 0.351061 |
import numpy as np
import pandas as pd
from misc import adaptive_colnames
def write_metapop_data(writer, metapop, topology, cycle, config):
"""Write information about the metapopulation to a CSV writer"""
# Here, diversity is only calculated based on adaptive loci. To add cooperation locus, use ['Coop'] + ad... | model/logfile.py | import numpy as np
import pandas as pd
from misc import adaptive_colnames
def write_metapop_data(writer, metapop, topology, cycle, config):
"""Write information about the metapopulation to a CSV writer"""
# Here, diversity is only calculated based on adaptive loci. To add cooperation locus, use ['Coop'] + ad... | 0.415492 | 0.408808 |
import unittest
import yaml
from linkml_runtime.linkml_model.meta import ClassDefinition, SlotDefinition, ElementName
import linkml_runtime.utils.yamlutils as yutils
from linkml_runtime.utils.dictutils import as_simple_dict
from tests.support.test_environment import TestEnvironmentTestCase
from tests.test_utils.envir... | tests/test_utils/test_dict_utils.py | import unittest
import yaml
from linkml_runtime.linkml_model.meta import ClassDefinition, SlotDefinition, ElementName
import linkml_runtime.utils.yamlutils as yutils
from linkml_runtime.utils.dictutils import as_simple_dict
from tests.support.test_environment import TestEnvironmentTestCase
from tests.test_utils.envir... | 0.448185 | 0.468851 |
import sys
import cli_client as cc
def clear_bgp_api(args):
api = cc.ApiClient()
keypath = []
body = None
asnval = None
address = ""
vrfname = ""
prefixip = ""
ifname = ""
pg = ""
af = ""
cinall = ""
clearall = ""
external = ""
cin = ""
cout = ""
soft = ""
asn, asnva... | src/CLI/actioner/sonic_cli_clear_bgp.py |
import sys
import cli_client as cc
def clear_bgp_api(args):
api = cc.ApiClient()
keypath = []
body = None
asnval = None
address = ""
vrfname = ""
prefixip = ""
ifname = ""
pg = ""
af = ""
cinall = ""
clearall = ""
external = ""
cin = ""
cout = ""
soft = ""
asn, asnva... | 0.184768 | 0.122287 |
import os.path as osp
from unittest import TestCase
import matplotlib.pyplot as plt
from pylinac import WinstonLutz
from pylinac.winston_lutz import GANTRY, COLLIMATOR, COUCH
from pylinac.core.geometry import Vector, vector_is_close
from tests import TEST_BANK_DIR
from tests.utils import save_file, LoadingTestBase, L... | tests/test_winstonlutz.py | import os.path as osp
from unittest import TestCase
import matplotlib.pyplot as plt
from pylinac import WinstonLutz
from pylinac.winston_lutz import GANTRY, COLLIMATOR, COUCH
from pylinac.core.geometry import Vector, vector_is_close
from tests import TEST_BANK_DIR
from tests.utils import save_file, LoadingTestBase, L... | 0.544559 | 0.480113 |
import json
import re
from django.contrib.auth import login
from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from django.views import View
from django_redis import get_redis_connection
from users.models import User
class UsernameCountView(View):
# 判断用户是否存在
de... | meiduo_mall/meiduo_mall/apps/users/views.py | import json
import re
from django.contrib.auth import login
from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from django.views import View
from django_redis import get_redis_connection
from users.models import User
class UsernameCountView(View):
# 判断用户是否存在
de... | 0.217587 | 0.070752 |
import warnings
from typing import Mapping, Optional
from src.deps.ext import bert_score as bert_score_lib
from src.utils.typing import Device, StrSequence
import rouge as rouge_lib
import sacrebleu
from torch.utils import data
# TODO(evandez): Move accuracy fns here?
# TODO(evandez): Commonize string normalization.... | src/utils/metrics.py | import warnings
from typing import Mapping, Optional
from src.deps.ext import bert_score as bert_score_lib
from src.utils.typing import Device, StrSequence
import rouge as rouge_lib
import sacrebleu
from torch.utils import data
# TODO(evandez): Move accuracy fns here?
# TODO(evandez): Commonize string normalization.... | 0.756178 | 0.562116 |
import collections
import requests
from catcher.steps.external_step import ExternalStep
from catcher.steps.step import Step, update_variables
class Salesforce(ExternalStep):
"""
Allows you to work with `Salesforce <https://www.salesforce.com/>`_.
:Config:
- instance: your Salesforce instance. *Opti... | catcher_modules/service/salesforce.py | import collections
import requests
from catcher.steps.external_step import ExternalStep
from catcher.steps.step import Step, update_variables
class Salesforce(ExternalStep):
"""
Allows you to work with `Salesforce <https://www.salesforce.com/>`_.
:Config:
- instance: your Salesforce instance. *Opti... | 0.595728 | 0.234325 |
import os
import shutil
from django.conf import settings
from base.services import get_example_assets_folder, get_lorem_ipsum
from extra_settings.models import Setting
class ExampleExtraSettings:
FILENAME = "favicon.png"
DATA = (
(
"ABOUT_US",
Setting.TYPE_TEXT,
ge... | backend/base/management/commands/_seed_example_extra_settings.py | import os
import shutil
from django.conf import settings
from base.services import get_example_assets_folder, get_lorem_ipsum
from extra_settings.models import Setting
class ExampleExtraSettings:
FILENAME = "favicon.png"
DATA = (
(
"ABOUT_US",
Setting.TYPE_TEXT,
ge... | 0.338733 | 0.07946 |
import sys
import shutil
from conans import ConanFile, CMake, tools
import os
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
class GoogleBenchmarkConan(ConanFile):
from gcc import GCC_VERSIONS, CURRENT_GCC_VERSION
with open(os.path.join(os.path.dirname(os.path.realpath... | google_benchmark/conanfile.py | import sys
import shutil
from conans import ConanFile, CMake, tools
import os
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
class GoogleBenchmarkConan(ConanFile):
from gcc import GCC_VERSIONS, CURRENT_GCC_VERSION
with open(os.path.join(os.path.dirname(os.path.realpath... | 0.222109 | 0.067547 |
import urllib.request
import numpy as np
import subprocess
import argparse
import os
import sys
from . import convert
# 上位ディレクトリのモジュールをインポートするためにsys.pathに上位ディレクトリのパスを追加する
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from sonde_sites import getSondeLocation
this_file_path = os.path.absp... | tools/MSMtool/interpolater.py | import urllib.request
import numpy as np
import subprocess
import argparse
import os
import sys
from . import convert
# 上位ディレクトリのモジュールをインポートするためにsys.pathに上位ディレクトリのパスを追加する
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from sonde_sites import getSondeLocation
this_file_path = os.path.absp... | 0.19046 | 0.240284 |
import flickrapi
import logging
import main
from .models import *
logger = logging.getLogger(__name__)
class FlickrCache:
api = None
# Flickr data
sets = []
photos = []
# Exclusions
sets_exclude = None
# Cached sets (just ids)
sets_cached = None
def __init__(self):
# ... | plugins/pelican-flickr/pelican-flickr/cache.py | import flickrapi
import logging
import main
from .models import *
logger = logging.getLogger(__name__)
class FlickrCache:
api = None
# Flickr data
sets = []
photos = []
# Exclusions
sets_exclude = None
# Cached sets (just ids)
sets_cached = None
def __init__(self):
# ... | 0.466359 | 0.123049 |
"""Test for using the model_eval_lib API."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import tensorflow as tf
from tensorflow_model_analysis.api import model_eval_lib
from tensorflow_model_analysis.eval_saved_model import ... | tensorflow_model_analysis/api/model_eval_lib_test.py | """Test for using the model_eval_lib API."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import tensorflow as tf
from tensorflow_model_analysis.api import model_eval_lib
from tensorflow_model_analysis.eval_saved_model import ... | 0.910287 | 0.514461 |
#! -*- coding:utf-8 -*-
import json
import codecs
from random import choice
from tqdm import tqdm
from keras.layers import *
from keras.models import Model
import keras.backend as K
from keras.callbacks import Callback
# Hyperparameter
train_data = json.load(open('../train_data.json', encoding='utf-8'))
val_data = js... | Model/HDU-AIModel.py |
#! -*- coding:utf-8 -*-
import json
import codecs
from random import choice
from tqdm import tqdm
from keras.layers import *
from keras.models import Model
import keras.backend as K
from keras.callbacks import Callback
# Hyperparameter
train_data = json.load(open('../train_data.json', encoding='utf-8'))
val_data = js... | 0.431225 | 0.186873 |
def aOrB16(a, b, c):
n = 0
i = 0
na, nb = 0, 0
for i in range(16):
a, ra = divmod(a, 2)
b, rb = divmod(b, 2)
c, rc = divmod(c, 2)
if rc == 0:
# il faut changer les 1 en 0 dans a et/ou b
n += ra + rb
else:
# si 0 dans a et b,... | algorithms/bit-manipulation/aorb.py |
def aOrB16(a, b, c):
n = 0
i = 0
na, nb = 0, 0
for i in range(16):
a, ra = divmod(a, 2)
b, rb = divmod(b, 2)
c, rc = divmod(c, 2)
if rc == 0:
# il faut changer les 1 en 0 dans a et/ou b
n += ra + rb
else:
# si 0 dans a et b,... | 0.290176 | 0.450903 |
import urllib.request
import json
PLUGIN_VERSION = 1
HEARTBEAT = "true"
#inputs needed for this plugin,
'''
provide the protocol on which the server is running
http (or) https
'''
PROTOCOL = 'http'
'''
provide the hostname on which the server is running
'''
HOSTNAME = 'localhost'
'''
provide the admin port of the ... | dropwizard_jvm_metrics/dropwizard_jvm_metrics.py |
import urllib.request
import json
PLUGIN_VERSION = 1
HEARTBEAT = "true"
#inputs needed for this plugin,
'''
provide the protocol on which the server is running
http (or) https
'''
PROTOCOL = 'http'
'''
provide the hostname on which the server is running
'''
HOSTNAME = 'localhost'
'''
provide the admin port of the ... | 0.365343 | 0.158858 |
import finparse
import pytest
@pytest.mark.parametrize('given, sign, expected', [
('$5.00', 1, '$5.00'),
('($5.00)', -1, '$5.00'),
('(($5.00))', 1, '$5.00'),
('($5.00))', -1, '$5.00)'),
('(($5.00)', -1, '($5.00'),
('$100,000', 1, '$100,000'),
('$100,000.', 1, '$100,000.'),
('$100,000.... | tests/finparse_test.py |
import finparse
import pytest
@pytest.mark.parametrize('given, sign, expected', [
('$5.00', 1, '$5.00'),
('($5.00)', -1, '$5.00'),
('(($5.00))', 1, '$5.00'),
('($5.00))', -1, '$5.00)'),
('(($5.00)', -1, '($5.00'),
('$100,000', 1, '$100,000'),
('$100,000.', 1, '$100,000.'),
('$100,000.... | 0.474875 | 0.663713 |
import hashlib
from optparse import make_option
import os
import re
import shutil
import time
import urllib2
from subprocess import call, PIPE
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import git
from jingo_minify.utils import get_media_root
path = lambda *a... | vendor-local/packages/jingo-minify/jingo_minify/management/commands/compress_assets.py | import hashlib
from optparse import make_option
import os
import re
import shutil
import time
import urllib2
from subprocess import call, PIPE
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import git
from jingo_minify.utils import get_media_root
path = lambda *a... | 0.326486 | 0.057998 |
from functools import partial
import sacrebleu
import numpy as np
from joeynmt.helpers import postprocess
def chrf(hypotheses, references):
"""
Character F-score from sacrebleu
:param hypotheses: list of hypotheses (strings)
:param references: list of references (strings)
:return:
"""
re... | joeynmt/metrics.py | from functools import partial
import sacrebleu
import numpy as np
from joeynmt.helpers import postprocess
def chrf(hypotheses, references):
"""
Character F-score from sacrebleu
:param hypotheses: list of hypotheses (strings)
:param references: list of references (strings)
:return:
"""
re... | 0.71103 | 0.721179 |
mixed_dict = {
"Michal" : 23,
"Felipe" : 32,
0: "zero",
True: "True",
False: True,
int: "True"
}
print(mixed_dict)
print(type(mixed_dict))
# Access
mixed_dict['Michal']
mixed_dict['Felipe']
mixed_dict[0] # Careful not the same as in lists this refers to name not to the position
mixed_dict[Tru... | 11_dictionaries.py | mixed_dict = {
"Michal" : 23,
"Felipe" : 32,
0: "zero",
True: "True",
False: True,
int: "True"
}
print(mixed_dict)
print(type(mixed_dict))
# Access
mixed_dict['Michal']
mixed_dict['Felipe']
mixed_dict[0] # Careful not the same as in lists this refers to name not to the position
mixed_dict[Tru... | 0.484868 | 0.400222 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro... | nssrc/com/citrix/netscaler/nitro/resource/config/basic/service.py |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro... | 0.540439 | 0.091342 |
import contextlib
import sys
import time
import warnings
from typing import List, Generator, Set
from logging import Logger
try:
import pyaudio
except ImportError:
pyaudio = None
warnings.warn('PyAudio is not installed!')
import can
import canopen
from canopen.pdo.base import Map
from being.can.cia_402 i... | being/backends.py | import contextlib
import sys
import time
import warnings
from typing import List, Generator, Set
from logging import Logger
try:
import pyaudio
except ImportError:
pyaudio = None
warnings.warn('PyAudio is not installed!')
import can
import canopen
from canopen.pdo.base import Map
from being.can.cia_402 i... | 0.658198 | 0.11836 |
from nltk.corpus import stopwords
from nltk.cluster.util import cosine_distance
import numpy as np
import networkx as nx
import nltk
from flask import Flask, render_template, request, send_file
from pptx import Presentation
p = Presentation()
nltk.download('stopwords')
def read_full_text(text):
td = text.splitlines... | main.py | from nltk.corpus import stopwords
from nltk.cluster.util import cosine_distance
import numpy as np
import networkx as nx
import nltk
from flask import Flask, render_template, request, send_file
from pptx import Presentation
p = Presentation()
nltk.download('stopwords')
def read_full_text(text):
td = text.splitlines... | 0.234231 | 0.103976 |
import json
import time
from servicex.transformer.servicex_adapter import ServiceXAdapter
from servicex.transformer.transformer_argument_parser import TransformerArgumentParser
from servicex.transformer.object_store_manager import ObjectStoreManager
from servicex.transformer.rabbit_mq_manager import RabbitMQManager
im... | transformer.py | import json
import time
from servicex.transformer.servicex_adapter import ServiceXAdapter
from servicex.transformer.transformer_argument_parser import TransformerArgumentParser
from servicex.transformer.object_store_manager import ObjectStoreManager
from servicex.transformer.rabbit_mq_manager import RabbitMQManager
im... | 0.432543 | 0.113432 |
import numpy as np
from spot_motion_monitor.config import PsdPlotConfig
from spot_motion_monitor.views import Psd1dPlotWidget
class TestPsd1dPlotWidget:
def test_parametersAfterConstruction(self, qtbot):
p1dpw = Psd1dPlotWidget()
qtbot.addWidget(p1dpw)
assert p1dpw.plot is not None
... | tests/views/test_psd_1d_plot_widget.py |
import numpy as np
from spot_motion_monitor.config import PsdPlotConfig
from spot_motion_monitor.views import Psd1dPlotWidget
class TestPsd1dPlotWidget:
def test_parametersAfterConstruction(self, qtbot):
p1dpw = Psd1dPlotWidget()
qtbot.addWidget(p1dpw)
assert p1dpw.plot is not None
... | 0.667256 | 0.548734 |
from __future__ import print_function, division, unicode_literals, absolute_import
import numpy as np
class Common(object):
def __init__(self):
self.rt_base_iir = {
'COM':{'man':{'fo': ('a', 'N')},
'min':{'fo': ('d', 'N'),
... | pyfda/filter_designs/common.py | from __future__ import print_function, division, unicode_literals, absolute_import
import numpy as np
class Common(object):
def __init__(self):
self.rt_base_iir = {
'COM':{'man':{'fo': ('a', 'N')},
'min':{'fo': ('d', 'N'),
... | 0.767254 | 0.32174 |
import re
import json
import time
import logging
import poplib
import smtplib
import datetime
import mimetypes
from email import encoders
from pathlib import Path
from email.parser import Parser
from email.header import Header
from email.utils import parseaddr
from caterpillar_log import Log
from email.mime.base import... | caterpillar_mail/__init__.py | import re
import json
import time
import logging
import poplib
import smtplib
import datetime
import mimetypes
from email import encoders
from pathlib import Path
from email.parser import Parser
from email.header import Header
from email.utils import parseaddr
from caterpillar_log import Log
from email.mime.base import... | 0.343342 | 0.072243 |
import requests
import json
"""
Provides a python interface to the MotorsportReg.com API using the requests library. This module only supports json.
See https://api.motorsportreg.com for authorization to use the API and details describing it.
pr_* prefixed functions are private API calls that require an MSR account th... | msrapi/__init__.py | import requests
import json
"""
Provides a python interface to the MotorsportReg.com API using the requests library. This module only supports json.
See https://api.motorsportreg.com for authorization to use the API and details describing it.
pr_* prefixed functions are private API calls that require an MSR account th... | 0.513425 | 0.276373 |
import logging
from lib import Strategier
from lib.utils import *
class BuyStrategier(Strategier):
"""
Provide algorithms and rules to determine if we should buy.
"""
def __init__(self, army, currency, granularity, num_buckets, term_n,
macd_short_n, macd_long_n, time_str
... | lib/BuyStrategier.py | import logging
from lib import Strategier
from lib.utils import *
class BuyStrategier(Strategier):
"""
Provide algorithms and rules to determine if we should buy.
"""
def __init__(self, army, currency, granularity, num_buckets, term_n,
macd_short_n, macd_long_n, time_str
... | 0.565419 | 0.283926 |
from github.Repository import Repository
from github.PaginatedList import PaginatedList
import time
import user
from cache import cache
def enum(**enums):
return type('Enum', (), enums)
Reasons = enum(
NONE="none",
ASSUMED="stars too less or too great",
REAL="real star is greater than fake ones",
... | repo.py | from github.Repository import Repository
from github.PaginatedList import PaginatedList
import time
import user
from cache import cache
def enum(**enums):
return type('Enum', (), enums)
Reasons = enum(
NONE="none",
ASSUMED="stars too less or too great",
REAL="real star is greater than fake ones",
... | 0.482429 | 0.074635 |
USER_AGENTS = ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
"Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel... | checkers/gallery/user_agents.py | USER_AGENTS = ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
"Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F Build/R16NW; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel... | 0.237664 | 0.143908 |
import argparse
import functools
import inspect
import sys
from types import SimpleNamespace
def extract_descriptions_from_docstring(docstring):
descriptions = {}
if docstring is not None:
docstring = docstring.strip()
first_param_index = docstring.find(":param")
post_param_descripti... | func_to_script/core.py | import argparse
import functools
import inspect
import sys
from types import SimpleNamespace
def extract_descriptions_from_docstring(docstring):
descriptions = {}
if docstring is not None:
docstring = docstring.strip()
first_param_index = docstring.find(":param")
post_param_descripti... | 0.373533 | 0.238944 |
# TenderCancellationResourceTest
def create_tender_cancellation(self):
response = self.app.post_json('/tenders/{}/cancellations?acc_token={}'.format(
self.tender_id, self.tender_token), {'data': {'reason': 'cancellation reason'}})
self.assertEqual(response.status, '201 Created')
self.assertEqual(... | openprocurement/tender/openua/tests/cancellation_blanks.py |
# TenderCancellationResourceTest
def create_tender_cancellation(self):
response = self.app.post_json('/tenders/{}/cancellations?acc_token={}'.format(
self.tender_id, self.tender_token), {'data': {'reason': 'cancellation reason'}})
self.assertEqual(response.status, '201 Created')
self.assertEqual(... | 0.487063 | 0.295065 |
from functools import partial
from io import BytesIO
from typing import Type
from podite._utils import _GetitemToCall, get_calling_module, get_concrete_type
from ..bytes import BYTES_CATALOG
from ..decorators import pod
from ..json import JSON_CATALOG, MISSING
def static_to_bytes_partial(packer, cls, buffer, obj, **... | podite/types/misc.py | from functools import partial
from io import BytesIO
from typing import Type
from podite._utils import _GetitemToCall, get_calling_module, get_concrete_type
from ..bytes import BYTES_CATALOG
from ..decorators import pod
from ..json import JSON_CATALOG, MISSING
def static_to_bytes_partial(packer, cls, buffer, obj, **... | 0.769167 | 0.140602 |
import time
import numpy as np
import tensorflow as tf
import scipy.io.wavfile as wav
from python_speech_features import mfcc
from utils import maybe_download as maybe_download
from utils import sparse_tuple_from as sparse_tuple_from
# Constants
SPACE_TOKEN = '<space>'
SPACE_INDEX = 0
# 0 is reserved to spa... | main.py | import time
import numpy as np
import tensorflow as tf
import scipy.io.wavfile as wav
from python_speech_features import mfcc
from utils import maybe_download as maybe_download
from utils import sparse_tuple_from as sparse_tuple_from
# Constants
SPACE_TOKEN = '<space>'
SPACE_INDEX = 0
# 0 is reserved to spa... | 0.649912 | 0.245153 |
import uuid
from rest_framework import mixins, status
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from rest_framework.decorators import action
from substrapp.serializers import LedgerComputePlanSerializer
from substrapp.ledger.api import invoke_ledger, query_ledger,... | backend/substrapp/views/computeplan.py | import uuid
from rest_framework import mixins, status
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from rest_framework.decorators import action
from substrapp.serializers import LedgerComputePlanSerializer
from substrapp.ledger.api import invoke_ledger, query_ledger,... | 0.603815 | 0.100967 |
import binascii
import re
import subprocess
import unicodedata
from conf import settings
class KeepassXCItem(object):
"""Representations class for a KeepassXC entry. """
def __init__(self, title, username, password, url, notes):
self.title = title
self.username = username
self.passwo... | src/services.py | import binascii
import re
import subprocess
import unicodedata
from conf import settings
class KeepassXCItem(object):
"""Representations class for a KeepassXC entry. """
def __init__(self, title, username, password, url, notes):
self.title = title
self.username = username
self.passwo... | 0.629775 | 0.123392 |
import json
from wrappers import SONATAClient
from wrappers.SONATAClient.auth import Auth
from wrappers.SONATAClient.vnfpkgm import VnfPkgm
from wrappers.SONATAClient.nsd import Nsd
from tests.sonata.config import *
import time
class Helpers():
def _upload_test_vnf(_token):
time.sleep(5)
... | tests/sonata/helpers.py | import json
from wrappers import SONATAClient
from wrappers.SONATAClient.auth import Auth
from wrappers.SONATAClient.vnfpkgm import VnfPkgm
from wrappers.SONATAClient.nsd import Nsd
from tests.sonata.config import *
import time
class Helpers():
def _upload_test_vnf(_token):
time.sleep(5)
... | 0.135146 | 0.085099 |
from agent_synth_game import AgentSynthGame
from adviser_framework import AdviserFramework
from models.corridor import corridor_directions_mdp
from models.misc import *
from models.office_generator import *
def running_example():
agents = [AgentSynthGame(mdp=corridor_directions_mdp(r_id='A', init_state='end_l_fr'... | main.py | from agent_synth_game import AgentSynthGame
from adviser_framework import AdviserFramework
from models.corridor import corridor_directions_mdp
from models.misc import *
from models.office_generator import *
def running_example():
agents = [AgentSynthGame(mdp=corridor_directions_mdp(r_id='A', init_state='end_l_fr'... | 0.419053 | 0.210026 |
from . import elastic
from . import githup
import aiohttp
import asyncio
import logging
log = logging.getLogger(__name__)
async def data_pipeline(source, target, main_data: dict[str, str]) -> None:
"""Async. data pipeline for collecting all tags from all github repositories and send them to elastic
Args:
... | my_modules/dump.py | from . import elastic
from . import githup
import aiohttp
import asyncio
import logging
log = logging.getLogger(__name__)
async def data_pipeline(source, target, main_data: dict[str, str]) -> None:
"""Async. data pipeline for collecting all tags from all github repositories and send them to elastic
Args:
... | 0.456168 | 0.198821 |
from leapp.actors import Actor
from leapp.exceptions import StopActorExecutionError
from leapp.models import Report, TcpWrappersFacts, InstalledRedHatSignedRPM
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
from leapp.libraries.stdlib import api
from leapp.libraries.actor.library import config_affects_daemons
fr... | repos/system_upgrade/el7toel8/actors/tcpwrapperscheck/actor.py | from leapp.actors import Actor
from leapp.exceptions import StopActorExecutionError
from leapp.models import Report, TcpWrappersFacts, InstalledRedHatSignedRPM
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
from leapp.libraries.stdlib import api
from leapp.libraries.actor.library import config_affects_daemons
fr... | 0.529993 | 0.136493 |
import sys
sys.path = ['..'] + sys.path
from src import idworker
import time
WORKER_MASK = 0x000000000001F000
DATACENTER_MASK = 0x00000000003E0000
TIMESTAMP_MASK = 0xFFFFFFFFFFC00000
def test_generate_id():
worker = idworker.IdWorker(1, 1)
tid = worker.next_id()
assert tid > 0
def test_generate_timestam... | test/test_idworker.py | import sys
sys.path = ['..'] + sys.path
from src import idworker
import time
WORKER_MASK = 0x000000000001F000
DATACENTER_MASK = 0x00000000003E0000
TIMESTAMP_MASK = 0xFFFFFFFFFFC00000
def test_generate_id():
worker = idworker.IdWorker(1, 1)
tid = worker.next_id()
assert tid > 0
def test_generate_timestam... | 0.174305 | 0.398406 |
import base64
from random import random
from io import StringIO, BytesIO
from struct import pack
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
I = 1
II = 2
III = 3
IV = 4
V = 5
VI = 6
VII = 7
VIII = 8
def offset(letter):
return ALPHABET.find(letter)
def offsets(letters):
return (offset(x) for x in letters... | enigma.py | import base64
from random import random
from io import StringIO, BytesIO
from struct import pack
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
I = 1
II = 2
III = 3
IV = 4
V = 5
VI = 6
VII = 7
VIII = 8
def offset(letter):
return ALPHABET.find(letter)
def offsets(letters):
return (offset(x) for x in letters... | 0.360602 | 0.348839 |
import spacy
import pandas as pd
from sklearn.decomposition import PCA
import matplotlib.cm as cm
import numpy as np
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
tsv_file = "../data/clusters/nl_4_topic_clusters.tsv"
content = pd.read_csv(tsv_file, sep="\t", keep_default_na=False, header=0, enc... | code/doc_vectors.py | import spacy
import pandas as pd
from sklearn.decomposition import PCA
import matplotlib.cm as cm
import numpy as np
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
tsv_file = "../data/clusters/nl_4_topic_clusters.tsv"
content = pd.read_csv(tsv_file, sep="\t", keep_default_na=False, header=0, enc... | 0.765067 | 0.605303 |
# pylint: disable=missing-docstring
# pylint: disable=logging-fstring-interpolation
# pylint: disable=attribute-defined-outside-init
import asyncio
import logging
import sys
from random import randint
class LoopApp():
def __init__(self):
self.__version = None
self.__tasks = []
self._... | src/main.py |
# pylint: disable=missing-docstring
# pylint: disable=logging-fstring-interpolation
# pylint: disable=attribute-defined-outside-init
import asyncio
import logging
import sys
from random import randint
class LoopApp():
def __init__(self):
self.__version = None
self.__tasks = []
self._... | 0.344664 | 0.104112 |
import sys
import multiprocessing
from collections import Counter
from os import cpu_count
import cv2
import redis
import numpy as np
from .keypoints import compute_keypoints
from .phash import triangles_from_keypoints, hash_triangles
def phash_triangles(img, triangles, batch_size=None):
n = len(triangles)
... | transformation_invariant_image_search/main.py | import sys
import multiprocessing
from collections import Counter
from os import cpu_count
import cv2
import redis
import numpy as np
from .keypoints import compute_keypoints
from .phash import triangles_from_keypoints, hash_triangles
def phash_triangles(img, triangles, batch_size=None):
n = len(triangles)
... | 0.320502 | 0.161122 |
import pytest
from django.urls import reverse
from core.client import _build_absolute_uri
@pytest.fixture
def data_list_no_licence_required():
return [
{
"count": 1,
"total_pages": 1,
"results": [
{
"id": "66297b19-8753-4f37-8b6d-83... | unit_tests/exporter/licences/test_views.py | import pytest
from django.urls import reverse
from core.client import _build_absolute_uri
@pytest.fixture
def data_list_no_licence_required():
return [
{
"count": 1,
"total_pages": 1,
"results": [
{
"id": "66297b19-8753-4f37-8b6d-83... | 0.470493 | 0.323642 |
import argparse
import sys
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import pandas as pd
from origamipy import plot
def main():
args = parse_args()
out_filebase = '{}_{}-lfes-melting'.format(args.output_filebase, args.t... | scripts/plotting/plot_melting-lfes.py | import argparse
import sys
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import pandas as pd
from origamipy import plot
def main():
args = parse_args()
out_filebase = '{}_{}-lfes-melting'.format(args.output_filebase, args.t... | 0.319121 | 0.292911 |
import string, urlparse, httplib, urllib, random
import datetime, threading, sys, time, collections
AllShortcodes = [
('http://10.130.32.52:58080/driver-container/incomingMessages/USSybase1/sms', [90001], ['Hello', 'Ciao', 'Hola', 'Salut']),
('http://10.130.32.52:58080/driver-container/incomingMessages/USSybas... | SyBlaster.py | import string, urlparse, httplib, urllib, random
import datetime, threading, sys, time, collections
AllShortcodes = [
('http://10.130.32.52:58080/driver-container/incomingMessages/USSybase1/sms', [90001], ['Hello', 'Ciao', 'Hola', 'Salut']),
('http://10.130.32.52:58080/driver-container/incomingMessages/USSybas... | 0.200323 | 0.152568 |
from django.core.exceptions import ObjectDoesNotExist
from django.utils.encoding import smart_text
from rest_framework import serializers
from wglog.models import Training, Set, User, TrainingName, AppSettings
# https://stackoverflow.com/questions/28009829/creating-and-saving-foreign-key-objects-using-a-slugrelated... | wglog_rest/serializers.py | from django.core.exceptions import ObjectDoesNotExist
from django.utils.encoding import smart_text
from rest_framework import serializers
from wglog.models import Training, Set, User, TrainingName, AppSettings
# https://stackoverflow.com/questions/28009829/creating-and-saving-foreign-key-objects-using-a-slugrelated... | 0.427277 | 0.14448 |
from generators.pascal import PascalVocGenerator
from models.resnet import centernet
import cv2
import os
import numpy as np
import time
from generators.utils import affine_transform, get_affine_transform
import os.path as osp
def preprocess_image(image, c, s, tgt_w, tgt_h):
trans_input = get_affine_transform(c,... | image_demo.py | from generators.pascal import PascalVocGenerator
from models.resnet import centernet
import cv2
import os
import numpy as np
import time
from generators.utils import affine_transform, get_affine_transform
import os.path as osp
def preprocess_image(image, c, s, tgt_w, tgt_h):
trans_input = get_affine_transform(c,... | 0.511229 | 0.316488 |
from spacy.lang.en import STOP_WORDS
import pickle
import spacy
import numpy as np
import pandas as pd
# Load up spacy model and import stop words
nlp = spacy.load('en_core_web_sm')
for word in STOP_WORDS:
lexeme = nlp.vocab[word]
lexeme.is_stop = True
def save_pickle(data, filename):
"""Saves the data i... | server/models/seq2seq/preprocess_data.py | from spacy.lang.en import STOP_WORDS
import pickle
import spacy
import numpy as np
import pandas as pd
# Load up spacy model and import stop words
nlp = spacy.load('en_core_web_sm')
for word in STOP_WORDS:
lexeme = nlp.vocab[word]
lexeme.is_stop = True
def save_pickle(data, filename):
"""Saves the data i... | 0.719285 | 0.326567 |
import json
import pytest
from click import ClickException
from connect.cli.core.config import Config
from connect.cli.plugins.report.helpers import (
execute_report,
list_reports,
load_repo,
show_report_info,
)
from connect.cli.plugins.report.utils import Progress
from connect.client import ConnectCl... | tests/plugins/report/test_helpers.py | import json
import pytest
from click import ClickException
from connect.cli.core.config import Config
from connect.cli.plugins.report.helpers import (
execute_report,
list_reports,
load_repo,
show_report_info,
)
from connect.cli.plugins.report.utils import Progress
from connect.client import ConnectCl... | 0.497803 | 0.347952 |
import matplotlib.pyplot as plt
def scatter_matrix(data):
pass
def hist(data, column, by=None, ax=None, fontsize=None):
keys, values = zip(*data.groupby(by)[column])
if ax is None:
ax = plt.gca()
ax.boxplot(values)
ax.set_xticklabels(keys, rotation=0, fontsize=fontsize)
return ax
def... | pandas/tools/plotting.py | import matplotlib.pyplot as plt
def scatter_matrix(data):
pass
def hist(data, column, by=None, ax=None, fontsize=None):
keys, values = zip(*data.groupby(by)[column])
if ax is None:
ax = plt.gca()
ax.boxplot(values)
ax.set_xticklabels(keys, rotation=0, fontsize=fontsize)
return ax
def... | 0.856242 | 0.656521 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
from .utils import _gather_feat, _tranpose_and_gather_feat
def _nms(heat, kernel=3):
pad = (kernel - 1) // 2
hmax = nn.functional.max_pool2d(
heat, (kernel,... | src/lib/models/decode.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
from .utils import _gather_feat, _tranpose_and_gather_feat
def _nms(heat, kernel=3):
pad = (kernel - 1) // 2
hmax = nn.functional.max_pool2d(
heat, (kernel,... | 0.770206 | 0.333232 |
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from astropy.config.paths import _find_home
import pytest
from ..cached_halo_catalog import CachedHaloCatalog, InvalidCacheLogEntry
from ...custom_exceptions import HalotoolsError
slow = pytest.mark.slow
aph_home... | halotools/sim_manager/tests/test_supported_sims.py | from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from astropy.config.paths import _find_home
import pytest
from ..cached_halo_catalog import CachedHaloCatalog, InvalidCacheLogEntry
from ...custom_exceptions import HalotoolsError
slow = pytest.mark.slow
aph_home... | 0.541894 | 0.328907 |
import smtplib
import sys
from email.mime.text import MIMEText
from email.utils import parseaddr, formataddr
from email.header import Header
from email import encoders
from welcome.models import Smtpmail, Article, Websiteinfo, ArticleRely
class Sendmail:
mail_username = ''
mail_password = ''
hos... | project/sendmail.py | import smtplib
import sys
from email.mime.text import MIMEText
from email.utils import parseaddr, formataddr
from email.header import Header
from email import encoders
from welcome.models import Smtpmail, Article, Websiteinfo, ArticleRely
class Sendmail:
mail_username = ''
mail_password = ''
hos... | 0.102619 | 0.069668 |
import scrapy
import json
import pandas as pd
import numpy as np
import logging
import requests
import urllib.request
from scrapy.utils.log import configure_logging
"""
Author: <NAME> - HASUKI1194
The script is commonly for scrapping the JSON data from the mobile phone (Android, iOS) via
API request using the scra... | tutorial/tutorial/spiders/main_spider.py | import scrapy
import json
import pandas as pd
import numpy as np
import logging
import requests
import urllib.request
from scrapy.utils.log import configure_logging
"""
Author: <NAME> - HASUKI1194
The script is commonly for scrapping the JSON data from the mobile phone (Android, iOS) via
API request using the scra... | 0.338624 | 0.222468 |
import csv
import sys
import numpy as np
from scipy.optimize import nnls
class Predictor(object):
def __init__(self, training_data_in=[], data_file=None):
'''
Initiliaze the Predictor with some training data
The training data should be a list of [mcs, input_fraction, time]
'''
self.tra... | predictor.py | import csv
import sys
import numpy as np
from scipy.optimize import nnls
class Predictor(object):
def __init__(self, training_data_in=[], data_file=None):
'''
Initiliaze the Predictor with some training data
The training data should be a list of [mcs, input_fraction, time]
'''
self.tra... | 0.431105 | 0.477432 |
from uno import *
from time import sleep
import file_configs
# Configs from 'file_configs.py'
file_configs.escrever() # If the file does not exist, it will generate one
debug = file_configs.debug() # Will decides if debug mode is on/off
debug_ai_joga_cartas = file_configs.debug_ai_joga_cartas() # If it is set false, ... | unopython/main.py |
from uno import *
from time import sleep
import file_configs
# Configs from 'file_configs.py'
file_configs.escrever() # If the file does not exist, it will generate one
debug = file_configs.debug() # Will decides if debug mode is on/off
debug_ai_joga_cartas = file_configs.debug_ai_joga_cartas() # If it is set false, ... | 0.275909 | 0.287152 |
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0001_add-ordering-models'),
]
operations = [
migrations.CreateModel(
name='CatalogItem',
... | shop/migrations/0002_add-catalog-models.py | from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0001_add-ordering-models'),
]
operations = [
migrations.CreateModel(
name='CatalogItem',
... | 0.627495 | 0.165391 |
import argparse
import logging
from django.conf import settings
from django.core.management import BaseCommand, CommandError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import LibraryLocatorV2
from openedx.core.djangoapps.content_libraries import api as contentlib_api
log = logging.getLo... | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/content_libraries/management/commands/content_libraries_import.py | import argparse
import logging
from django.conf import settings
from django.core.management import BaseCommand, CommandError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import LibraryLocatorV2
from openedx.core.djangoapps.content_libraries import api as contentlib_api
log = logging.getLo... | 0.493164 | 0.10226 |
import numpy as np
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
def _in_projection_packed(q, k, v, w, b):
if k is v:
if q is k:
# self-attention
w = F.transpose(w, (1, 0))
to_ret = F.affine(q, w, b, base_axis=2)
... | vision-and-language/clip/clip/model.py |
import numpy as np
import nnabla as nn
import nnabla.functions as F
import nnabla.parametric_functions as PF
def _in_projection_packed(q, k, v, w, b):
if k is v:
if q is k:
# self-attention
w = F.transpose(w, (1, 0))
to_ret = F.affine(q, w, b, base_axis=2)
... | 0.718002 | 0.382603 |
from flask import Flask, render_template, request, redirect, abort, g, url_for
from .tx_listener import listen
from .models import Account
from .utils import get_steem_conn, Pagination, get_payout_from_rshares, Coins
from .settings import SITE_URL
from dateutil.parser import parse
from datetime import datetime, timede... | steemrocks/app.py | from flask import Flask, render_template, request, redirect, abort, g, url_for
from .tx_listener import listen
from .models import Account
from .utils import get_steem_conn, Pagination, get_payout_from_rshares, Coins
from .settings import SITE_URL
from dateutil.parser import parse
from datetime import datetime, timede... | 0.54819 | 0.085175 |
from typing import Iterator
import conllu
import numpy as np
import networkx as nx
import tensorflow as tf
def label_matrices_padding(label_matrices, max_length):
'''Pads label matrices to max length
Args:
label_matrics (List[np.ndarray])
max_length (int)
Returns:
padded_matrice... | bert_repro/probe/data.py | from typing import Iterator
import conllu
import numpy as np
import networkx as nx
import tensorflow as tf
def label_matrices_padding(label_matrices, max_length):
'''Pads label matrices to max length
Args:
label_matrics (List[np.ndarray])
max_length (int)
Returns:
padded_matrice... | 0.765418 | 0.380529 |
from robofab.world import CurrentFont
alts = ['a.alt', 'A.swash', 'B.swash', 'C.alt', 'E.alt', 'E.altswash', 'E.swash', 'F.alt', 'F.altswash', 'F.swash', 'G.alt', 'h.swash', 'H.swash', 'J.alt', 'L.alt', 'm.swash', 'n.swash', 'P.swash', 'Q.alt', 'R.swash', 'R.swash2', 'S.alt', 'T.alt', 'Z.alt']
... | makeAltsSample.py | from robofab.world import CurrentFont
alts = ['a.alt', 'A.swash', 'B.swash', 'C.alt', 'E.alt', 'E.altswash', 'E.swash', 'F.alt', 'F.altswash', 'F.swash', 'G.alt', 'h.swash', 'H.swash', 'J.alt', 'L.alt', 'm.swash', 'n.swash', 'P.swash', 'Q.alt', 'R.swash', 'R.swash2', 'S.alt', 'T.alt', 'Z.alt']
... | 0.22448 | 0.128854 |
import argparse
import os
import time
from io import BytesIO
import numpy as np
import pandas as pd
import torch
from PIL import Image
from torchvision.transforms import functional
from models import get_model, get_iou_types
from models.mimic.split_rcnn import split_rcnn_model
from myutils.common import yaml_util
fro... | src/cost_analyzer.py | import argparse
import os
import time
from io import BytesIO
import numpy as np
import pandas as pd
import torch
from PIL import Image
from torchvision.transforms import functional
from models import get_model, get_iou_types
from models.mimic.split_rcnn import split_rcnn_model
from myutils.common import yaml_util
fro... | 0.517571 | 0.249493 |
import ida_hexrays
class HxEvent(object):
"""
Enum object for the hexrays event. This is documented in
https://www.hex-rays.com/products/decompiler/manual/sdk/hexrays_8hpp.shtml
https://www.hex-rays.com/products/decompiler/manual/sdk/hexrays_8hpp_source.shtml
and defined in ``ida_h... | bip/hexrays/event.py | import ida_hexrays
class HxEvent(object):
"""
Enum object for the hexrays event. This is documented in
https://www.hex-rays.com/products/decompiler/manual/sdk/hexrays_8hpp.shtml
https://www.hex-rays.com/products/decompiler/manual/sdk/hexrays_8hpp_source.shtml
and defined in ``ida_h... | 0.455683 | 0.179441 |
import pickle
import os
import re
from inspect import signature
from os.path import dirname, abspath, join
from collections import OrderedDict
from io import StringIO
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktLanguageVars
decorated_features = OrderedDict()
#The current python file must be in the sa... | textual_feature.py | import pickle
import os
import re
from inspect import signature
from os.path import dirname, abspath, join
from collections import OrderedDict
from io import StringIO
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktLanguageVars
decorated_features = OrderedDict()
#The current python file must be in the sa... | 0.200245 | 0.22028 |
from __future__ import absolute_import
from itertools import ifilter, izip
from ableton.v2.base import flatten, liveobj_valid
from pushbase.device_chain_utils import find_instrument_devices
from pushbase.drum_group_component import DrumGroupComponent as DrumGroupComponentBase, DrumPadCopyHandler as DrumPadCopyHandlerB... | Push2/drum_group_component.py |
from __future__ import absolute_import
from itertools import ifilter, izip
from ableton.v2.base import flatten, liveobj_valid
from pushbase.device_chain_utils import find_instrument_devices
from pushbase.drum_group_component import DrumGroupComponent as DrumGroupComponentBase, DrumPadCopyHandler as DrumPadCopyHandlerB... | 0.600305 | 0.078395 |
import MaxPlus
import pymxs
import itertools
import os
rt = pymxs.runtime
def getAllNodes():
return getChildren(MaxPlus.Core.GetRootNode())
def getFacesCount(nodes):
total_faces = 0
for n in nodes:
total_faces += n.GetFaceCount()
return total_faces
def getTrisCount(nodes)... | scripts/maxsdk/node.py | import MaxPlus
import pymxs
import itertools
import os
rt = pymxs.runtime
def getAllNodes():
return getChildren(MaxPlus.Core.GetRootNode())
def getFacesCount(nodes):
total_faces = 0
for n in nodes:
total_faces += n.GetFaceCount()
return total_faces
def getTrisCount(nodes)... | 0.13012 | 0.196672 |
import unittest
import requests
from core.get_modules import load_all_modules
API_URL = 'http://127.0.0.1:5000'
class TestApi(unittest.TestCase):
def test_index(self):
"""
Test if the API is running
"""
response = requests.get(API_URL)
self.assertEqual(response.status_cod... | tests/test_api.py | import unittest
import requests
from core.get_modules import load_all_modules
API_URL = 'http://127.0.0.1:5000'
class TestApi(unittest.TestCase):
def test_index(self):
"""
Test if the API is running
"""
response = requests.get(API_URL)
self.assertEqual(response.status_cod... | 0.551332 | 0.264528 |
import os, subprocess
import tkinter as tk
from tkinter import *
repository_url = "https://github.com/official-srv-modak/StockAll.git"
update_file_path = "update.bat"
def close_frame(root):
root.destroy()
def give_pop_up_dialog(message, height, width, button_needed):
dialog = tk.Tk()
dialog.title("FYI")
... | stock_market/update.py | import os, subprocess
import tkinter as tk
from tkinter import *
repository_url = "https://github.com/official-srv-modak/StockAll.git"
update_file_path = "update.bat"
def close_frame(root):
root.destroy()
def give_pop_up_dialog(message, height, width, button_needed):
dialog = tk.Tk()
dialog.title("FYI")
... | 0.14734 | 0.067056 |
import sys
import socket
def __init__(self, maxpeers, serverport, myid=None, serverhost=None):
self.debug = 0
self.maxpeers = int(maxpeers)
self.serverport = int(serverport)
# If not supplied, the host name/IP address will be determined
# by attempting to connect to an Internet host l... | peer.py | import sys
import socket
def __init__(self, maxpeers, serverport, myid=None, serverhost=None):
self.debug = 0
self.maxpeers = int(maxpeers)
self.serverport = int(serverport)
# If not supplied, the host name/IP address will be determined
# by attempting to connect to an Internet host l... | 0.068029 | 0.041095 |
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from parse_config import ConfigParser
class dilated_conv(nn.Module):
""" same as original conv if dilation equals to 1 """
def __init__(self, in_channel, out_channel, kernel_size=3, dropout_rate=0.0, a... | models/UNet.py | import time
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from parse_config import ConfigParser
class dilated_conv(nn.Module):
""" same as original conv if dilation equals to 1 """
def __init__(self, in_channel, out_channel, kernel_size=3, dropout_rate=0.0, a... | 0.924347 | 0.367554 |
from pymodelica import compile_fmux,compile_fmu
from casadi import SymbolicOCP
from pyfmi import load_fmu
import os
import zipfile
def compileModelica(class_name,models_list):
fmux_name = compile_fmux(class_name=class_name,
file_name=models_list,
co... | modelCompiler/modelCompiler.py | from pymodelica import compile_fmux,compile_fmu
from casadi import SymbolicOCP
from pyfmi import load_fmu
import os
import zipfile
def compileModelica(class_name,models_list):
fmux_name = compile_fmux(class_name=class_name,
file_name=models_list,
co... | 0.077108 | 0.142232 |
import pandas as pd
from sklearn.preprocessing import StandardScaler
# Scoring
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score
from statsmodels.stats.outliers_influence import variance_inflation_factor
from sklearn.metrics import mean_squared_error, r2_score
# Algorithms
from sklea... | regressor_results.py | import pandas as pd
from sklearn.preprocessing import StandardScaler
# Scoring
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score
from statsmodels.stats.outliers_influence import variance_inflation_factor
from sklearn.metrics import mean_squared_error, r2_score
# Algorithms
from sklea... | 0.79049 | 0.418281 |
from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
import svmutil
import arrayio
from genomicode import filelib... | Betsy/Betsy/modules/classify_with_svm.py | from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
import svmutil
import arrayio
from genomicode import filelib... | 0.405096 | 0.241182 |
import graphene
from graphene import relay
from graphene_sqlalchemy import SQLAlchemyObjectType
from ..models import Map as MapModel
from ..db.sa import sa
##__________________________________________________________________||
class Map(SQLAlchemyObjectType):
class Meta:
model = MapModel
interfac... | acondbs/schema/map_.py | import graphene
from graphene import relay
from graphene_sqlalchemy import SQLAlchemyObjectType
from ..models import Map as MapModel
from ..db.sa import sa
##__________________________________________________________________||
class Map(SQLAlchemyObjectType):
class Meta:
model = MapModel
interfac... | 0.418935 | 0.189015 |
from __future__ import print_function
import sys
import time
import os
import glob
import shutil
import subprocess
import itertools
import tempfile
SETUPTOOLS_MIN_VER = '3.3'
import setuptools
from pkg_resources import parse_version # included in setuptools
print('using setuptools version', setuptools.__version__)
... | setup.py | from __future__ import print_function
import sys
import time
import os
import glob
import shutil
import subprocess
import itertools
import tempfile
SETUPTOOLS_MIN_VER = '3.3'
import setuptools
from pkg_resources import parse_version # included in setuptools
print('using setuptools version', setuptools.__version__)
... | 0.275422 | 0.055336 |
import datetime
from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from users.managers import UserManager
class User(AbstractBaseUser):
"""Покупатель"""
STATUS_ADMIN = 0
STATUS_CUSTOMER = 1
STATUS_WHOLESALE = 2
STATUS_FRANCHISEE = 3
STATUS_CHOICES = (
... | _site/tomat/apps/users/models.py |
import datetime
from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from users.managers import UserManager
class User(AbstractBaseUser):
"""Покупатель"""
STATUS_ADMIN = 0
STATUS_CUSTOMER = 1
STATUS_WHOLESALE = 2
STATUS_FRANCHISEE = 3
STATUS_CHOICES = (
... | 0.514888 | 0.138987 |
import copy
import sys
from repoxplorer.controllers.renderers import CSVRenderer
# RepoXplorer configuration file
base_logging = {
'version': 1,
'root': {'level': 'DEBUG', 'handlers': ['normal']},
'loggers': {
'indexerDaemon': {
'level': 'DEBUG',
'handlers': ['normal', 'con... | config.py | import copy
import sys
from repoxplorer.controllers.renderers import CSVRenderer
# RepoXplorer configuration file
base_logging = {
'version': 1,
'root': {'level': 'DEBUG', 'handlers': ['normal']},
'loggers': {
'indexerDaemon': {
'level': 'DEBUG',
'handlers': ['normal', 'con... | 0.172869 | 0.116186 |
# Author: <NAME> <<EMAIL>>
import numpy as np
from sklearn.utils.validation import check_random_state
from sklearn.cluster import KMeans
from perturbation_classifiers.base import BasePerC
from perturbation_classifiers.perturbation import perturbation_mean, perturbation_covariance, perturbation_combination
from pert... | perturbation_classifiers/subconcept/sperc.py |
# Author: <NAME> <<EMAIL>>
import numpy as np
from sklearn.utils.validation import check_random_state
from sklearn.cluster import KMeans
from perturbation_classifiers.base import BasePerC
from perturbation_classifiers.perturbation import perturbation_mean, perturbation_covariance, perturbation_combination
from pert... | 0.887241 | 0.468851 |
from django.http import Http404
from rest_framework import serializers
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_registration.decorators import (
api_view_serializer_class,
api_view_serializer_class_getter
)
fro... | venv/lib/python3.6/site-packages/rest_registration/api/views/register_email.py | from django.http import Http404
from rest_framework import serializers
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_registration.decorators import (
api_view_serializer_class,
api_view_serializer_class_getter
)
fro... | 0.561816 | 0.058615 |
from cv2 import getPerspectiveTransform, getRotationMatrix2D, transform, warpPerspective
from lsd import line_segment_detector
from numpy import abs, array, asarray, arctan2, eye, float32, ndarray, pi, rad2deg, zeros_like
from numpy.linalg import det, inv, qr
from PIL import Image
from sklearn.linear_model import RANS... | rawio/align/vertical.py |
from cv2 import getPerspectiveTransform, getRotationMatrix2D, transform, warpPerspective
from lsd import line_segment_detector
from numpy import abs, array, asarray, arctan2, eye, float32, ndarray, pi, rad2deg, zeros_like
from numpy.linalg import det, inv, qr
from PIL import Image
from sklearn.linear_model import RANS... | 0.933582 | 0.657442 |
def list_known_essentials(input_files = None, headerlines=3, verbose=True):
''' Get all known essential genes from two different files and combine them in one list.
Input is a list of of paths where files can be found with the known essential genes.
A default list is implemented using two files pr... | python_scripts/python_modules/essential_genes_names.py |
def list_known_essentials(input_files = None, headerlines=3, verbose=True):
''' Get all known essential genes from two different files and combine them in one list.
Input is a list of of paths where files can be found with the known essential genes.
A default list is implemented using two files pr... | 0.322846 | 0.607052 |
from __future__ import print_function, absolute_import, division
from gi.repository import Gtk, cairo
from toga.cassowary.widget import Container as CassowaryContainer
class GtkContainer(Gtk.Fixed):
def __init__(self, layout_manager):
super(GtkContainer, self).__init__()
self.layout_manager = la... | toga/platform/gtk/widgets/container.py | from __future__ import print_function, absolute_import, division
from gi.repository import Gtk, cairo
from toga.cassowary.widget import Container as CassowaryContainer
class GtkContainer(Gtk.Fixed):
def __init__(self, layout_manager):
super(GtkContainer, self).__init__()
self.layout_manager = la... | 0.545286 | 0.143338 |
import logging
import os
import sys
from copy import deepcopy
import networkx as nx
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
os.environ["OMP_NUM_THREADS"] = "1" # export OMP_NUM_THREADS=1
os.environ["OPENBLAS_NUM_THREADS"] = "1" # export OPENBLAS_NUM_THREADS=1
os.enviro... | RegMutCoe/build_coe.py | import logging
import os
import sys
from copy import deepcopy
import networkx as nx
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
os.environ["OMP_NUM_THREADS"] = "1" # export OMP_NUM_THREADS=1
os.environ["OPENBLAS_NUM_THREADS"] = "1" # export OPENBLAS_NUM_THREADS=1
os.enviro... | 0.359139 | 0.267653 |
import os
import sys
import geocoder
import tweepy
import json
import csv
import re
from matplotlib import pylab as plt
import numpy
import math
from textblob import TextBlob
from scipy import stats
# setting global variables
sentiment_score = []
count = 0
keyword = 'keyword'
# Defining the main function of the scr... | twitter_sentiment_analyzer/tweet_analyzer.py | import os
import sys
import geocoder
import tweepy
import json
import csv
import re
from matplotlib import pylab as plt
import numpy
import math
from textblob import TextBlob
from scipy import stats
# setting global variables
sentiment_score = []
count = 0
keyword = 'keyword'
# Defining the main function of the scr... | 0.316581 | 0.142769 |
import nbformat
from metapack import MetapackDoc
from metapack.cli.core import prt, err
from metapack_jupyter.core import logger, edit_notebook, get_cell_source, set_cell_source
from metapack_jupyter.exporters import NotebookExecutor, DocumentationExporter
from metapack_jupyter.preprocessors import ExtractInlineMetatab... | src/metapack_jupyter/convert.py | import nbformat
from metapack import MetapackDoc
from metapack.cli.core import prt, err
from metapack_jupyter.core import logger, edit_notebook, get_cell_source, set_cell_source
from metapack_jupyter.exporters import NotebookExecutor, DocumentationExporter
from metapack_jupyter.preprocessors import ExtractInlineMetatab... | 0.362518 | 0.269061 |
from torch.optim import RMSprop
from torch.optim.lr_scheduler import MultiStepLR
from torchvision.transforms import RandomHorizontalFlip, Compose
from torchvision.transforms import RandomResizedCrop
from torchvision.transforms import ColorJitter, ToTensor, Normalize
from common.dataset import FilesFromCsvDataset
from c... | classification/imaterialist_challenge_furniture_2018/configs/train/train_inceptionresnetv2_350_ssd_like.py | from torch.optim import RMSprop
from torch.optim.lr_scheduler import MultiStepLR
from torchvision.transforms import RandomHorizontalFlip, Compose
from torchvision.transforms import RandomResizedCrop
from torchvision.transforms import ColorJitter, ToTensor, Normalize
from common.dataset import FilesFromCsvDataset
from c... | 0.79799 | 0.523359 |
from dataclasses import dataclass, field
from typing import Dict, List, Tuple
from dataclasses_jsonschema import JsonSchemaMixin
import numpy as np
from docsim.elas.search import EsResult
from docsim.embedding.base import return_matrix
from docsim.embedding.fasttext import FastText
from docsim.methods.base import Met... | docsim/methods/methods/norm.py | from dataclasses import dataclass, field
from typing import Dict, List, Tuple
from dataclasses_jsonschema import JsonSchemaMixin
import numpy as np
from docsim.elas.search import EsResult
from docsim.embedding.base import return_matrix
from docsim.embedding.fasttext import FastText
from docsim.methods.base import Met... | 0.88999 | 0.323514 |
from __future__ import annotations
import argparse
import json
import logging
import pathlib
import typing
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Type
import apischema
import lark
from .. import transformer
from ..common import AnyPath, FullLoadContext, LoadContext, StringW... | whatrecord/plugins/epicsarch.py | from __future__ import annotations
import argparse
import json
import logging
import pathlib
import typing
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Type
import apischema
import lark
from .. import transformer
from ..common import AnyPath, FullLoadContext, LoadContext, StringW... | 0.870136 | 0.154217 |
from __future__ import annotations
from dataclasses import dataclass
from typing import Dict
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry, OptionsFlow
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import call... | custom_components/weight_gurus/config_flow.py | from __future__ import annotations
from dataclasses import dataclass
from typing import Dict
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry, OptionsFlow
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import call... | 0.909072 | 0.128279 |
from flask_restx import Resource, reqparse
from flask_babel import gettext
from flask import jsonify
from flask import request
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address, get_ipaddr
import base64
from opentera.crypto.crypto_utils import generate_device_certificate, load_private_... | teraserver/python/modules/FlaskModule/API/device/DeviceRegister.py | from flask_restx import Resource, reqparse
from flask_babel import gettext
from flask import jsonify
from flask import request
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address, get_ipaddr
import base64
from opentera.crypto.crypto_utils import generate_device_certificate, load_private_... | 0.534612 | 0.084833 |
import os
import sys
import time
import optparse
base_dir=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)
from core.sfile_server import SfileServer
from lib.file_lib import SimpleConfig
from lib.wrapper import get_aes_crypt,get_rsa_crypt
from lib import file_lib
config_path=os.... | bin/sfile.py | import os
import sys
import time
import optparse
base_dir=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)
from core.sfile_server import SfileServer
from lib.file_lib import SimpleConfig
from lib.wrapper import get_aes_crypt,get_rsa_crypt
from lib import file_lib
config_path=os.... | 0.09886 | 0.106226 |