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
donkeycar/tests/test_web_socket.py
wenxichen/donkeycar
12
6600
from donkeycar.parts.web_controller.web import WebSocketCalibrateAPI from functools import partial from tornado import testing import tornado.websocket import tornado.web import tornado.ioloop import json from unittest.mock import Mock from donkeycar.parts.actuator import PWMSteering, PWMThrottle class WebSocketCal...
from donkeycar.parts.web_controller.web import WebSocketCalibrateAPI from functools import partial from tornado import testing import tornado.websocket import tornado.web import tornado.ioloop import json from unittest.mock import Mock from donkeycar.parts.actuator import PWMSteering, PWMThrottle class WebSocketCal...
en
0.774755
Example of WebSocket usage as a client in AsyncHTTPTestCase-based unit tests. # Now we can run a test on the WebSocket. # Now we can run a test on the WebSocket. # Now we can run a test on the WebSocket. # Now we can run a test on the WebSocket.
2.651921
3
misc/trac_plugins/IncludeMacro/includemacro/macros.py
weese/seqan
1
6601
<reponame>weese/seqan # TracIncludeMacro macros import re import urllib2 from StringIO import StringIO from trac.core import * from trac.wiki.macros import WikiMacroBase from trac.wiki.formatter import system_message from trac.wiki.model import WikiPage from trac.mimeview.api import Mimeview, get_mimetype, Context fro...
# TracIncludeMacro macros import re import urllib2 from StringIO import StringIO from trac.core import * from trac.wiki.macros import WikiMacroBase from trac.wiki.formatter import system_message from trac.wiki.model import WikiPage from trac.mimeview.api import Mimeview, get_mimetype, Context from trac.perm import IPe...
en
0.802082
# TracIncludeMacro macros A macro to include other resources in wiki pages. More documentation to follow. # Default output formats for sources that need them # IWikiMacroProvider methods # Shortcut. # Whether or not to disable cleaning HTML. # Parse out fragment name. # Pull out the arguments # If no : is present, ...
2.374384
2
packages/google/cloud/logging/client.py
rjcuevas/Email-Frontend-AngularJS-
0
6602
# Copyright 2016 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 law or agreed to in writing, ...
# Copyright 2016 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 law or agreed to in writing, ...
en
0.719632
# Copyright 2016 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 law or agreed to in writing, ...
1.471249
1
tests/test_core/test_graph_objs/test_instantiate_hierarchy.py
wwwidonja/changed_plotly
0
6603
from __future__ import absolute_import from unittest import TestCase import os import importlib import inspect from plotly.basedatatypes import BasePlotlyType, BaseFigure datatypes_root = "new_plotly/graph_objs" datatype_modules = [ dirpath.replace("/", ".") for dirpath, _, _ in os.walk(datatypes_root) if...
from __future__ import absolute_import from unittest import TestCase import os import importlib import inspect from plotly.basedatatypes import BasePlotlyType, BaseFigure datatypes_root = "new_plotly/graph_objs" datatype_modules = [ dirpath.replace("/", ".") for dirpath, _, _ in os.walk(datatypes_root) if...
none
1
2.289495
2
mycli/packages/special/main.py
lyrl/mycli
10,997
6604
<gh_stars>1000+ import logging from collections import namedtuple from . import export log = logging.getLogger(__name__) NO_QUERY = 0 PARSED_QUERY = 1 RAW_QUERY = 2 SpecialCommand = namedtuple('SpecialCommand', ['handler', 'command', 'shortcut', 'description', 'arg_type', 'hidden', 'case_sensiti...
import logging from collections import namedtuple from . import export log = logging.getLogger(__name__) NO_QUERY = 0 PARSED_QUERY = 1 RAW_QUERY = 2 SpecialCommand = namedtuple('SpecialCommand', ['handler', 'command', 'shortcut', 'description', 'arg_type', 'hidden', 'case_sensitive']) COMMANDS ...
en
0.731562
Execute a special command and return the results. If the special command is not supported a KeyError will be raised. # "help <SQL KEYWORD> is a special case. We want built-in help, not # mycli help here. # All the parameters are ignored. Call the built-in "show <command>", to display help for an SQL keyword. :p...
2.51717
3
core/sample_fuzzer/data_generators/base.py
ShreyasTheOne/Super-Duper-Fuzzer
0
6605
<filename>core/sample_fuzzer/data_generators/base.py from abc import ABC, abstractmethod class BaseDataGenerator(ABC): def __init__(self): pass @staticmethod @abstractmethod def generate(cls): pass
<filename>core/sample_fuzzer/data_generators/base.py from abc import ABC, abstractmethod class BaseDataGenerator(ABC): def __init__(self): pass @staticmethod @abstractmethod def generate(cls): pass
none
1
2.351965
2
Mon_08_06/convert2.py
TungTNg/itc110_python
0
6606
# convert2.py # A program to convert Celsius temps to Fahrenheit. # This version issues heat and cold warnings. def main(): celsius = float(input("What is the Celsius temperature? ")) fahrenheit = 9 / 5 * celsius + 32 print("The temperature is", fahrenheit, "degrees fahrenheit.") if fahrenhei...
# convert2.py # A program to convert Celsius temps to Fahrenheit. # This version issues heat and cold warnings. def main(): celsius = float(input("What is the Celsius temperature? ")) fahrenheit = 9 / 5 * celsius + 32 print("The temperature is", fahrenheit, "degrees fahrenheit.") if fahrenhei...
en
0.501979
# convert2.py # A program to convert Celsius temps to Fahrenheit. # This version issues heat and cold warnings.
4.194
4
homeassistant/components/wolflink/__init__.py
basicpail/core
11
6607
"""The Wolf SmartSet Service integration.""" from datetime import timedelta import logging from httpx import ConnectError, ConnectTimeout from wolf_smartset.token_auth import InvalidAuth from wolf_smartset.wolf_client import FetchFailed, ParameterReadError, WolfClient from homeassistant.config_entries import ConfigEn...
"""The Wolf SmartSet Service integration.""" from datetime import timedelta import logging from httpx import ConnectError, ConnectTimeout from wolf_smartset.token_auth import InvalidAuth from wolf_smartset.wolf_client import FetchFailed, ParameterReadError, WolfClient from homeassistant.config_entries import ConfigEn...
en
0.64508
The Wolf SmartSet Service integration. Set up Wolf SmartSet Service from a config entry. Update all stored entities for Wolf SmartSet. Unload a config entry. Fetch all available parameters with usage of WolfClient. By default Reglertyp entity is removed because API will not provide value for this parameter. Fetch ...
1.95832
2
src/levenshtein_distance.py
chunribu/python-algorithms
0
6608
<gh_stars>0 class LevenshteinDistance: def solve(self, str_a, str_b): a, b = str_a, str_b dist = {(x,y):0 for x in range(len(a)) for y in range(len(b))} for x in range(len(a)): dist[(x,-1)] = x+1 for y in range(len(b)): dist[(-1,y)] = y+1 dist[(-1,-1)] = 0 for i in ra...
class LevenshteinDistance: def solve(self, str_a, str_b): a, b = str_a, str_b dist = {(x,y):0 for x in range(len(a)) for y in range(len(b))} for x in range(len(a)): dist[(x,-1)] = x+1 for y in range(len(b)): dist[(-1,y)] = y+1 dist[(-1,-1)] = 0 for i in range(len(a)):...
none
1
3.232454
3
pyapprox/benchmarks/test_spectral_diffusion.py
ConnectedSystems/pyapprox
26
6609
<gh_stars>10-100 import numpy as np import unittest from pyapprox.benchmarks.spectral_diffusion import ( kronecker_product_2d, chebyshev_derivative_matrix, SteadyStateDiffusionEquation2D, SteadyStateDiffusionEquation1D ) from pyapprox.univariate_polynomials.quadrature import gauss_jacobi_pts_wts_1D import pyap...
import numpy as np import unittest from pyapprox.benchmarks.spectral_diffusion import ( kronecker_product_2d, chebyshev_derivative_matrix, SteadyStateDiffusionEquation2D, SteadyStateDiffusionEquation1D ) from pyapprox.univariate_polynomials.quadrature import gauss_jacobi_pts_wts_1D import pyapprox as pya cla...
en
0.624969
# I return points and calculate derivatives using reverse order of # points compared to what is used by Matlab cheb function thus the # derivative matrix I return will be the negative of the matlab version solve u(x)'' = 0, u(0) = 0, u(1) = 0.5 solve u(x)'' = -1, u(0) = 0, u(1) = 1 solution u(x) = -0.5*(x-3.)*...
2.472341
2
torchdrug/layers/flow.py
wconnell/torchdrug
772
6610
import torch from torch import nn from torch.nn import functional as F from torchdrug import layers class ConditionalFlow(nn.Module): """ Conditional flow transformation from `Masked Autoregressive Flow for Density Estimation`_. .. _Masked Autoregressive Flow for Density Estimation: https://arxi...
import torch from torch import nn from torch.nn import functional as F from torchdrug import layers class ConditionalFlow(nn.Module): """ Conditional flow transformation from `Masked Autoregressive Flow for Density Estimation`_. .. _Masked Autoregressive Flow for Density Estimation: https://arxi...
en
0.553758
Conditional flow transformation from `Masked Autoregressive Flow for Density Estimation`_. .. _Masked Autoregressive Flow for Density Estimation: https://arxiv.org/pdf/1705.07057.pdf Parameters: input_dim (int): input & output dimension condition_dim (int): condition dimension ...
2.744971
3
olctools/accessoryFunctions/metadataprinter.py
lowandrew/OLCTools
1
6611
<filename>olctools/accessoryFunctions/metadataprinter.py #!/usr/bin/env python3 import logging import json import os __author__ = 'adamkoziol' class MetadataPrinter(object): def printmetadata(self): # Iterate through each sample in the analysis for sample in self.metadata: # Set the n...
<filename>olctools/accessoryFunctions/metadataprinter.py #!/usr/bin/env python3 import logging import json import os __author__ = 'adamkoziol' class MetadataPrinter(object): def printmetadata(self): # Iterate through each sample in the analysis for sample in self.metadata: # Set the n...
en
0.729372
#!/usr/bin/env python3 # Iterate through each sample in the analysis # Set the name of the json file # Open the metadata file to write # Write the json dump of the object dump to the metadata file # Print useful information in case of an error
2.879725
3
mindware/estimators.py
aman-gupta-1995/Machine-Learning-Mindware
27
6612
import numpy as np from sklearn.utils.multiclass import type_of_target from mindware.base_estimator import BaseEstimator from mindware.components.utils.constants import type_dict, MULTILABEL_CLS, IMG_CLS, TEXT_CLS, OBJECT_DET from mindware.components.feature_engineering.transformation_graph import DataNode class Clas...
import numpy as np from sklearn.utils.multiclass import type_of_target from mindware.base_estimator import BaseEstimator from mindware.components.utils.constants import type_dict, MULTILABEL_CLS, IMG_CLS, TEXT_CLS, OBJECT_DET from mindware.components.feature_engineering.transformation_graph import DataNode class Clas...
en
0.590754
This class implements the classification task. # Check the task type: {binary, multiclass} Fit the classifier to given training data. :param data: instance of DataNode :return: self Predict classes for X. :param X: Datanode :param batch_size: int :param n_jobs: int :retur...
2.468398
2
AnimeSpider/spiders/AinmeLinkList.py
xiaowenwen1995/AnimeSpider
7
6613
# -*- coding: utf-8 -*- import scrapy import json import os import codecs from AnimeSpider.items import AnimespiderItem class AinmelinklistSpider(scrapy.Spider): name = 'AinmeLinkList' allowed_domains = ['bilibili.com'] start_urls = ['http://bilibili.com/'] def start_requests(self): jsonpath ...
# -*- coding: utf-8 -*- import scrapy import json import os import codecs from AnimeSpider.items import AnimespiderItem class AinmelinklistSpider(scrapy.Spider): name = 'AinmeLinkList' allowed_domains = ['bilibili.com'] start_urls = ['http://bilibili.com/'] def start_requests(self): jsonpath ...
en
0.769321
# -*- coding: utf-8 -*-
2.819396
3
Module 1/Chapter 7/prog1.py
PacktPublishing/Raspberry-Pi-Making-Amazing-Projects-Right-from-Scratch-
3
6614
<reponame>PacktPublishing/Raspberry-Pi-Making-Amazing-Projects-Right-from-Scratch- import cv2 print cv2.__version__
import cv2 print cv2.__version__
none
1
1.051798
1
setup.py
darlenew/pytest-testplan
0
6615
"""Setup for pytest-testplan plugin.""" from setuptools import setup setup( name='pytest-testplan', version='0.1.0', description='A pytest plugin to generate a CSV test report.', author='<NAME>', author_email='<EMAIL>', license='MIT', py_modules=['pytest_testplan'], install_requires=['...
"""Setup for pytest-testplan plugin.""" from setuptools import setup setup( name='pytest-testplan', version='0.1.0', description='A pytest plugin to generate a CSV test report.', author='<NAME>', author_email='<EMAIL>', license='MIT', py_modules=['pytest_testplan'], install_requires=['...
en
0.530819
Setup for pytest-testplan plugin.
1.28412
1
examples/industrial_quality_inspection/train_yolov3.py
petr-kalinin/PaddleX
1
6616
<reponame>petr-kalinin/PaddleX # 环境变量配置,用于控制是否使用GPU # 说明文档:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html#gpu import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' from paddlex.det import transforms import paddlex as pdx # 下载和解压铝材缺陷检测数据集 aluminum_dataset = 'https://bj.bcebos.com/paddlex/examples/i...
# 环境变量配置,用于控制是否使用GPU # 说明文档:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html#gpu import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' from paddlex.det import transforms import paddlex as pdx # 下载和解压铝材缺陷检测数据集 aluminum_dataset = 'https://bj.bcebos.com/paddlex/examples/industrial_quality_inspection/da...
zh
0.314527
# 环境变量配置,用于控制是否使用GPU # 说明文档:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html#gpu # 下载和解压铝材缺陷检测数据集 # 定义训练和验证时的transforms # API说明 https://paddlex.readthedocs.io/zh_CN/develop/apis/transforms/det_transforms.html # 定义训练和验证所用的数据集 # API说明:https://paddlex.readthedocs.io/zh_CN/develop/apis/datasets.html#pa...
2.340918
2
api/migrations/0004_auto_20210107_2032.py
bartoszper/Django-REST-API-movierater
0
6617
# Generated by Django 3.1.4 on 2021-01-07 19:32 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20210107_2010'), ] operations = [ migrations.AlterField( model_name='extrainfo...
# Generated by Django 3.1.4 on 2021-01-07 19:32 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20210107_2010'), ] operations = [ migrations.AlterField( model_name='extrainfo...
en
0.814058
# Generated by Django 3.1.4 on 2021-01-07 19:32
1.70241
2
wooey/migrations/0009_script_versioning.py
macdaliot/Wooey
1
6618
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wooey.models.mixins class Migration(migrations.Migration): dependencies = [ ('wooey', '0008_short_param_admin'), ] operations = [ migrations.CreateModel( ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wooey.models.mixins class Migration(migrations.Migration): dependencies = [ ('wooey', '0008_short_param_admin'), ] operations = [ migrations.CreateModel( name='Scr...
en
0.769321
# -*- coding: utf-8 -*-
1.75563
2
vendor/munkireport/firewall/scripts/firewall.py
menamegaly/MR
0
6619
#!/usr/bin/python """ Firewall for munkireport. By Tuxudo Will return all details about how the firewall is configured """ import subprocess import os import sys import platform import re import plistlib import json sys.path.insert(0,'/usr/local/munki') sys.path.insert(0, '/usr/local/munkireport') from munkilib impo...
#!/usr/bin/python """ Firewall for munkireport. By Tuxudo Will return all details about how the firewall is configured """ import subprocess import os import sys import platform import re import plistlib import json sys.path.insert(0,'/usr/local/munki') sys.path.insert(0, '/usr/local/munkireport') from munkilib impo...
en
0.653149
#!/usr/bin/python Firewall for munkireport. By Tuxudo Will return all details about how the firewall is configured Uses system profiler to get firewall info for the machine. # system_profiler xml is an array Un-nest firewall info, return array with objects with relevant keys Main # Skip manual check # Create cache dir ...
2.425318
2
cf_step/metrics.py
dpoulopoulos/cf_step
25
6620
<reponame>dpoulopoulos/cf_step<gh_stars>10-100 # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/metrics.ipynb (unless otherwise specified). __all__ = ['recall_at_k', 'precision_at_k'] # Cell from typing import List # Cell def recall_at_k(predictions: List[int], targets: List[int], k: int = 10) -> float: """Comput...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/metrics.ipynb (unless otherwise specified). __all__ = ['recall_at_k', 'precision_at_k'] # Cell from typing import List # Cell def recall_at_k(predictions: List[int], targets: List[int], k: int = 10) -> float: """Computes `Recall@k` from the given predictions and ta...
en
0.751243
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/metrics.ipynb (unless otherwise specified). # Cell # Cell Computes `Recall@k` from the given predictions and targets sets. # Cell Computes `Precision@k` from the given predictions and targets sets.
2.617697
3
bicycleparameters/period.py
sandertyu/Simple-Geometry-Plot
20
6621
<reponame>sandertyu/Simple-Geometry-Plot<filename>bicycleparameters/period.py #!/usr/bin/env/ python import os from math import pi import numpy as np from numpy import ma from scipy.optimize import leastsq import matplotlib.pyplot as plt from uncertainties import ufloat # local modules from .io import load_pendulum_...
#!/usr/bin/env/ python import os from math import pi import numpy as np from numpy import ma from scipy.optimize import leastsq import matplotlib.pyplot as plt from uncertainties import ufloat # local modules from .io import load_pendulum_mat_file def average_rectified_sections(data): '''Returns a slice of an o...
en
0.806885
#!/usr/bin/env/ python # local modules Returns a slice of an oscillating data vector based on the max and min of the mean of the sections created by retifiying the data. Parameters ---------- data : ndarray, shape(n,) Returns ------- data : ndarray, shape(m,) A slice where m is typ...
2.971143
3
tectosaur2/analyze.py
tbenthompson/BIE_tutorials
1
6622
import time import warnings import matplotlib.pyplot as plt import numpy as np import sympy as sp from .global_qbx import global_qbx_self from .mesh import apply_interp_mat, gauss_rule, panelize_symbolic_surface, upsample def find_dcutoff_refine(kernel, src, tol, plot=False): # prep step 1: find d_cutoff and d_...
import time import warnings import matplotlib.pyplot as plt import numpy as np import sympy as sp from .global_qbx import global_qbx_self from .mesh import apply_interp_mat, gauss_rule, panelize_symbolic_surface, upsample def find_dcutoff_refine(kernel, src, tol, plot=False): # prep step 1: find d_cutoff and d_...
en
0.802905
# prep step 1: find d_cutoff and d_refine # The goal is to estimate the error due to the QBX local patch # The local surface will have singularities at the tips where it is cut off # These singularities will cause error in the QBX expansion. We want to make # the local patch large enough that these singularities are ir...
1.81086
2
celery-getting-started/celeryconfig.py
hustbeta/python-examples
0
6623
<gh_stars>0 # -*- coding: utf-8 -*- BROKER_URL = 'amqp://guest@localhost//' CELERY_ACCEPT_CONTENT = ['json'], CELERY_RESULT_BACKEND = 'amqp://guest@localhost//' CELERY_RESULT_SERIALIZER = 'json' CELERY_TASK_SERIALIZER = 'json' CELERY_TIMEZONE = 'Asia/Shanghai' CELERY_ENABLE_UTC = False
# -*- coding: utf-8 -*- BROKER_URL = 'amqp://guest@localhost//' CELERY_ACCEPT_CONTENT = ['json'], CELERY_RESULT_BACKEND = 'amqp://guest@localhost//' CELERY_RESULT_SERIALIZER = 'json' CELERY_TASK_SERIALIZER = 'json' CELERY_TIMEZONE = 'Asia/Shanghai' CELERY_ENABLE_UTC = False
en
0.769321
# -*- coding: utf-8 -*-
1.54051
2
smartnlp/utils/basic_log.py
msgi/nlp-tour
1,559
6624
import logging as log class Log: def __init__(self, level): self.level = level log.basicConfig(format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s', level=level) self.log = log def info(self, msg): self.log.info(msg) de...
import logging as log class Log: def __init__(self, level): self.level = level log.basicConfig(format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s', level=level) self.log = log def info(self, msg): self.log.info(msg) de...
none
1
3.149004
3
people/losses-bkp.py
dluvizon/3d-pose-consensus
5
6625
<gh_stars>1-10 def structural_loss_dst68j3d(p_pred, v_pred): v_pred = K.stop_gradient(v_pred) def getlength(v): return K.sqrt(K.sum(K.square(v), axis=-1)) """Arms segments""" joints_arms = p_pred[:, :, 16:37+1, :] conf_arms = v_pred[:, :, 16:37+1] diff_arms_r = joints_arms[:, :, 2:-...
def structural_loss_dst68j3d(p_pred, v_pred): v_pred = K.stop_gradient(v_pred) def getlength(v): return K.sqrt(K.sum(K.square(v), axis=-1)) """Arms segments""" joints_arms = p_pred[:, :, 16:37+1, :] conf_arms = v_pred[:, :, 16:37+1] diff_arms_r = joints_arms[:, :, 2:-1:2, :] - joints...
en
0.659091
Arms segments Legs segments Limbs segments # euclidean # geodesic Reference lengths based on ground truth poses from Human3.6M: Spine wrt. ref: 0.715 (0.032 std.) Spine wrt. euclidean: 1.430 (maximum) (0.046 std.) MidHead wrt. ref: 0.266 (0.019 std.) Shoulder wrt. ref...
2.198112
2
Examples/IMAP/FilteringMessagesFromIMAPMailbox.py
Muzammil-khan/Aspose.Email-Python-Dotnet
5
6626
import aspose.email from aspose.email.clients.imap import ImapClient from aspose.email.clients import SecurityOptions from aspose.email.clients.imap import ImapQueryBuilder import datetime as dt def run(): dataDir = "" #ExStart: FetchEmailMessageFromServer client = ImapClient("imap.gmail.com", 993, "user...
import aspose.email from aspose.email.clients.imap import ImapClient from aspose.email.clients import SecurityOptions from aspose.email.clients.imap import ImapQueryBuilder import datetime as dt def run(): dataDir = "" #ExStart: FetchEmailMessageFromServer client = ImapClient("imap.gmail.com", 993, "user...
en
0.394845
#ExStart: FetchEmailMessageFromServer #ExEnd: FetchEmailMessageFromServer
2.63967
3
Python.FancyBear/settings.py
010001111/Vx-Suites
2
6627
# Server UID SERVER_UID = 45158729 # Setup Logging system ######################################### # import os from FileConsoleLogger import FileConsoleLogger ServerLogger = FileConsoleLogger( os.path.join(os.path.dirname(os.path.abspath(__file__)), "_w3server.log") ) W3Logger = FileConsoleLogger( os.path.join(os.pa...
# Server UID SERVER_UID = 45158729 # Setup Logging system ######################################### # import os from FileConsoleLogger import FileConsoleLogger ServerLogger = FileConsoleLogger( os.path.join(os.path.dirname(os.path.abspath(__file__)), "_w3server.log") ) W3Logger = FileConsoleLogger( os.path.join(os.pa...
de
0.388456
# Server UID # Setup Logging system ######################################### # # # Setup Level 2 Protocol - P2Scheme ######################################### # # P2_DATA_TOKEN = 'd8<PASSWORD>'.decode('hex') # # Setup Level 3 Protocol - P3Scheme ######################################### # # # # # Setup HTTP checker # ...
1.808977
2
tools/fileinfo/features/certificates-info/test.py
HoundThe/retdec-regression-tests
0
6628
<gh_stars>0 from regression_tests import * class Test1(Test): settings = TestSettings( tool='fileinfo', input='8b280f2b7788520de214fa8d6ea32a30ebb2a51038381448939530fd0f7dfc16', args='--json --verbose' ) def test_certificates(self): assert self.fileinfo.succeeded ...
from regression_tests import * class Test1(Test): settings = TestSettings( tool='fileinfo', input='8b280f2b7788520de214fa8d6ea32a30ebb2a51038381448939530fd0f7dfc16', args='--json --verbose' ) def test_certificates(self): assert self.fileinfo.succeeded assert self....
de
0.553023
# 2 certificates are there indeed stored twice, confirmed with LIEF #######################################################################
2.239823
2
app/darn.py
AmitSrourDev/darn
0
6629
import subprocess def run(cmd): subprocess.run(cmd.split(' ')) def ls(): subprocess.call(["ls", "-l"])
import subprocess def run(cmd): subprocess.run(cmd.split(' ')) def ls(): subprocess.call(["ls", "-l"])
none
1
2.095619
2
virt/ansible-latest/lib/python2.7/site-packages/ansible/plugins/become/runas.py
lakhlaifi/RedHat-Ansible
1
6630
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ become: runas short_description: Run As user ...
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ become: runas short_description: Run As user ...
en
0.820789
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) become: runas short_description: Run As user description: - This become plugins allows your remote/login user to execute commands as another user vi...
1.701473
2
2017/lab_dh/utils.py
JustHitTheCore/ctf_workshops
7
6631
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ~Gros ''' from hashlib import sha256 import random def add_padding(data, block_size=16): """add PKCS#7 padding""" size = block_size - (len(data)%block_size) return data+chr(size)*size def strip_padding(data, block_size=16): """strip PKCS#7 padding"...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ~Gros ''' from hashlib import sha256 import random def add_padding(data, block_size=16): """add PKCS#7 padding""" size = block_size - (len(data)%block_size) return data+chr(size)*size def strip_padding(data, block_size=16): """strip PKCS#7 padding"...
ru
0.151816
#!/usr/bin/env python # -*- coding: utf-8 -*- ~Gros add PKCS#7 padding strip PKCS#7 padding
3.214552
3
applications/cli/commands/model/tests/test_export.py
nparkstar/nauta
390
6632
# # Copyright (c) 2019 Intel Corporation # # 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 law or agreed to...
# # Copyright (c) 2019 Intel Corporation # # 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 law or agreed to...
en
0.851126
# # Copyright (c) 2019 Intel Corporation # # 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 law or agreed to...
1.831076
2
var/spack/repos/builtin/packages/py-mdanalysis/package.py
LiamBindle/spack
2,360
6633
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyMdanalysis(PythonPackage): """MDAnalysis is a Python toolkit to analyze molecular dynami...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyMdanalysis(PythonPackage): """MDAnalysis is a Python toolkit to analyze molecular dynami...
en
0.735965
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) MDAnalysis is a Python toolkit to analyze molecular dynamics trajectories generated by a wide range of popular simulati...
1.358223
1
lesley-byte/graphpressure.py
lesley-byte/enviroplus-python
0
6634
from requests import get import matplotlib.pyplot as plt import matplotlib.animation as animation import datetime as dt from bme280 import BME280 try: from smbus2 import SMBus except ImportError: from smbus import SMBus fig = plt.figure() ax = fig.add_subplot(1, 1, 1) xs = [] ys =[] bus = SMBus(1) bme280 = ...
from requests import get import matplotlib.pyplot as plt import matplotlib.animation as animation import datetime as dt from bme280 import BME280 try: from smbus2 import SMBus except ImportError: from smbus import SMBus fig = plt.figure() ax = fig.add_subplot(1, 1, 1) xs = [] ys =[] bus = SMBus(1) bme280 = ...
none
1
2.878376
3
bootstrapvz/plugins/ova/tasks.py
brett-smith/bootstrap-vz
0
6635
<reponame>brett-smith/bootstrap-vz<gh_stars>0 from bootstrapvz.base import Task from bootstrapvz.common import phases from bootstrapvz.common.tasks import workspace import os import shutil assets = os.path.normpath(os.path.join(os.path.dirname(__file__), 'assets')) class CheckOVAPath(Task): description = 'Checking ...
from bootstrapvz.base import Task from bootstrapvz.common import phases from bootstrapvz.common.tasks import workspace import os import shutil assets = os.path.normpath(os.path.join(os.path.dirname(__file__), 'assets')) class CheckOVAPath(Task): description = 'Checking if the OVA file already exists' phase = phase...
en
0.405551
# List of OVF disk format URIs # Snatched from VBox source (src/VBox/Main/src-server/ApplianceImpl.cpp:47) # ISOURI = "http://www.ecma-international.org/publications/standards/Ecma-119.htm" # VMDKStreamURI = "http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" # VMDKSparseURI = "http://www.vmware...
2.354033
2
docs/conf.py
PhilippJunk/homelette
0
6636
<gh_stars>0 # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -----------------------------------------------------------...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
en
0.613518
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If exte...
1.653579
2
bytecode2ast/parsers/bases.py
Cologler/bytecode2ast-python
0
6637
<gh_stars>0 # -*- coding: utf-8 -*- # # Copyright (c) 2019~2999 - Cologler <<EMAIL>> # ---------- # some object for parser # ---------- from typing import List import enum import dis from collections import defaultdict class ID: def __init__(self, name): self._name = name # a name use to debug def _...
# -*- coding: utf-8 -*- # # Copyright (c) 2019~2999 - Cologler <<EMAIL>> # ---------- # some object for parser # ---------- from typing import List import enum import dis from collections import defaultdict class ID: def __init__(self, name): self._name = name # a name use to debug def __repr__(self...
en
0.789247
# -*- coding: utf-8 -*- # # Copyright (c) 2019~2999 - Cologler <<EMAIL>> # ---------- # some object for parser # ---------- # a name use to debug # ensure has last block # all handled instrs in this state # state add a state, also ensure it does not exists. # instrs add a handled instruction in this state get all instr...
2.649895
3
netbox/extras/forms.py
orphanedgamboa/netbox
1
6638
<filename>netbox/extras/forms.py from django import forms from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils.safestring import mark_safe from django.utils.translation import gettext as _ from dcim.models import DeviceRole, DeviceType, Platform, Regi...
<filename>netbox/extras/forms.py from django import forms from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils.safestring import mark_safe from django.utils.translation import gettext as _ from dcim.models import DeviceRole, DeviceType, Platform, Regi...
en
0.715464
# # Custom fields # Extend Form to include custom field support. # Append relevant custom fields to the form instance # Annotate the field in the list of CustomField form fields Extend ModelForm to include custom field support. Append form fields for all CustomFields assigned to this model. # Append form fields; assign...
2.089406
2
unwarp_models.py
zgjslc/Film-Recovery-master1
0
6639
import torch import torch.nn as nn import torch.nn.functional as F from models.misc import modules constrain_path = { ('threeD', 'normal'): (True, True, ''), ('threeD', 'depth'): (True, True, ''), ('normal', 'depth'): (True, True, ''), ('depth', 'normal'): (True, True, ''), } class UnwarpNet(nn.Modu...
import torch import torch.nn as nn import torch.nn.functional as F from models.misc import modules constrain_path = { ('threeD', 'normal'): (True, True, ''), ('threeD', 'depth'): (True, True, ''), ('normal', 'depth'): (True, True, ''), ('depth', 'normal'): (True, True, ''), } class UnwarpNet(nn.Modu...
en
0.419198
# self.albedo_decoder = modules.AlbedoDecoder(downsample=6, out_channels=1) # geo_feature = torch.cat([threeD_feature, nor_feature, dep_feature], dim=1)
2.052682
2
endpoint/test_endpoint/update.py
pansila/Auto-Test-System
14
6640
<filename>endpoint/test_endpoint/update.py import configparser import os import hashlib import json import shutil import sys import tempfile import subprocess import tarfile import re import stat from functools import cmp_to_key from contextlib import closing from gzip import GzipFile from pathlib import Path from urll...
<filename>endpoint/test_endpoint/update.py import configparser import os import hashlib import json import shutil import sys import tempfile import subprocess import tarfile import re import stat from functools import cmp_to_key from contextlib import closing from gzip import GzipFile from pathlib import Path from urll...
en
0.627498
\ import os, sys import re import subprocess def _which_python(): allowed_executables = ["python3", "python"] if sys.platform == 'win32': # in favor of 32 bit python to be compatible with the 32bit dlls of test libraries allowed_executables[:0] = ["py.exe -3-32", "py.exe -2-32", "py.exe -3-64",...
2.129325
2
lib/jbgp/jbgpneighbor.py
routedo/junos-pyez-example
0
6641
<gh_stars>0 """ Query BGP neighbor table on a Juniper network device. """ import sys from jnpr.junos import Device from jnpr.junos.factory import loadyaml def juniper_bgp_state(dev, bgp_neighbor): """ This function queries the BGP neighbor table on a Juniper network device. dev = Juniper device connectio...
""" Query BGP neighbor table on a Juniper network device. """ import sys from jnpr.junos import Device from jnpr.junos.factory import loadyaml def juniper_bgp_state(dev, bgp_neighbor): """ This function queries the BGP neighbor table on a Juniper network device. dev = Juniper device connection bgp_ne...
en
0.810266
Query BGP neighbor table on a Juniper network device. This function queries the BGP neighbor table on a Juniper network device. dev = Juniper device connection bgp_neighbor = IP address of BGP neighbor return = Returns state of BGP neighbor
2.526337
3
lib/cherrypy/cherrypy/test/test_sessionauthenticate.py
MiCHiLU/google_appengine_sdk
790
6642
<gh_stars>100-1000 import cherrypy from cherrypy.test import helper class SessionAuthenticateTest(helper.CPWebCase): def setup_server(): def check(username, password): # Dummy check_username_and_password function if username != 'test' or password != 'password': ...
import cherrypy from cherrypy.test import helper class SessionAuthenticateTest(helper.CPWebCase): def setup_server(): def check(username, password): # Dummy check_username_and_password function if username != 'test' or password != 'password': return 'Wrong...
en
0.802451
# Dummy check_username_and_password function # A simple tool to add some things to request.params # This is to check to make sure that session_auth can handle request # params (ticket #780) # request a page and check for login form # setup credentials # attempt a login # get the page now that we are logged in # do a lo...
2.648111
3
2021/day-12/solve.py
amochtar/adventofcode
1
6643
#!/usr/bin/env python from typing import List import aoc from collections import defaultdict @aoc.timing def solve(inp: str, part2=False): def find_path(current: str, path: List[str] = []): if current == 'end': yield path return for nxt in caves[current]: if n...
#!/usr/bin/env python from typing import List import aoc from collections import defaultdict @aoc.timing def solve(inp: str, part2=False): def find_path(current: str, path: List[str] = []): if current == 'end': yield path return for nxt in caves[current]: if n...
ru
0.26433
#!/usr/bin/env python
3.42823
3
PaddleCV/tracking/ltr/data/processing.py
suytingwan/models
5
6644
<gh_stars>1-10 import numpy as np from ltr.data import transforms import ltr.data.processing_utils as prutils from pytracking.libs import TensorDict class BaseProcessing: """ Base class for Processing. Processing class is used to process the data returned by a dataset, before passing it through the...
import numpy as np from ltr.data import transforms import ltr.data.processing_utils as prutils from pytracking.libs import TensorDict class BaseProcessing: """ Base class for Processing. Processing class is used to process the data returned by a dataset, before passing it through the network. For e...
en
0.773329
Base class for Processing. Processing class is used to process the data returned by a dataset, before passing it through the network. For example, it can be used to crop a search region around the object, apply various data augmentations, etc. args: transform - The set of transformations ...
3.293672
3
tqcli/config/config.py
Tranquant/tqcli
0
6645
<reponame>Tranquant/tqcli import logging from os.path import expanduser #TQ_API_ROOT_URL = 'http://127.0.1.1:8090/dataset' TQ_API_ROOT_URL = 'http://elb-tranquant-ecs-cluster-tqapi-1919110681.us-west-2.elb.amazonaws.com/dataset' LOG_PATH = expanduser('~/tqcli.log') # the chunk size must be at least 5MB for multipart ...
import logging from os.path import expanduser #TQ_API_ROOT_URL = 'http://127.0.1.1:8090/dataset' TQ_API_ROOT_URL = 'http://elb-tranquant-ecs-cluster-tqapi-1919110681.us-west-2.elb.amazonaws.com/dataset' LOG_PATH = expanduser('~/tqcli.log') # the chunk size must be at least 5MB for multipart upload DEFAULT_CHUNK_SIZE ...
en
0.737351
#TQ_API_ROOT_URL = 'http://127.0.1.1:8090/dataset' # the chunk size must be at least 5MB for multipart upload # 5MB # define a Handler which writes INFO messages or higher to the sys.stderr # set a format which is simpler for console use # tell the handler to use this format # add the handler to the root logger
2.19312
2
fqf_iqn_qrdqn/agent/base_agent.py
rainwangphy/fqf-iqn-qrdqn.pytorch
0
6646
<gh_stars>0 from abc import ABC, abstractmethod import os import numpy as np import torch from torch.utils.tensorboard import SummaryWriter from fqf_iqn_qrdqn.memory import LazyMultiStepMemory, \ LazyPrioritizedMultiStepMemory from fqf_iqn_qrdqn.utils import RunningMeanStats, LinearAnneaer class BaseAgent(ABC): ...
from abc import ABC, abstractmethod import os import numpy as np import torch from torch.utils.tensorboard import SummaryWriter from fqf_iqn_qrdqn.memory import LazyMultiStepMemory, \ LazyPrioritizedMultiStepMemory from fqf_iqn_qrdqn.utils import RunningMeanStats, LinearAnneaer class BaseAgent(ABC): def __i...
en
0.922992
# torch.backends.cudnn.deterministic = True # It harms a performance. # torch.backends.cudnn.benchmark = False # It harms a performance. # Replay memory which is memory-efficient to store stacked frames. # Use e-greedy for evaluation. # Act with randomness. # Act without randomness. # NOTE: Noises can be sampled only...
2.219887
2
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/italian/timeperiod_extractor_config.py
felaray/Recognizers-Text
0
6647
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from typing import List, Pattern from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import Extractor from recognizers_number.number.italian.extractors import ItalianIntegerExtractor from ....
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from typing import List, Pattern from recognizers_text.utilities import RegExpUtility from recognizers_text.extractor import Extractor from recognizers_number.number.italian.extractors import ItalianIntegerExtractor from ....
en
0.853886
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License.
2.246251
2
quartet_condor.py
BotanyHunter/QuartetAnalysis
0
6648
<reponame>BotanyHunter/QuartetAnalysis #quartet_condor.py #version 2.0.2 import random, sys def addToDict(d): ''' Ensures each quartet has three concordance factors (CFs) a dictionary d has less than three CFs, add CFs with the value 0 until there are three Input: a dictionary containing CFs, a count...
#quartet_condor.py #version 2.0.2 import random, sys def addToDict(d): ''' Ensures each quartet has three concordance factors (CFs) a dictionary d has less than three CFs, add CFs with the value 0 until there are three Input: a dictionary containing CFs, a counter of how many CFs are in the dictionar...
en
0.920002
#quartet_condor.py #version 2.0.2 Ensures each quartet has three concordance factors (CFs) a dictionary d has less than three CFs, add CFs with the value 0 until there are three Input: a dictionary containing CFs, a counter of how many CFs are in the dictionary Picks individual quartets and isolates concordance...
3.349106
3
src/profiles/forms.py
rahulroshan96/CloudVisual
0
6649
<gh_stars>0 from django import forms from models import UserInputModel class UserInputForm(forms.ModelForm): class Meta: model = UserInputModel fields = ['user_input']
from django import forms from models import UserInputModel class UserInputForm(forms.ModelForm): class Meta: model = UserInputModel fields = ['user_input']
none
1
2.056491
2
tests_oval_graph/test_arf_xml_parser/test_arf_xml_parser.py
Honny1/oval-graph
21
6650
from pathlib import Path import pytest from oval_graph.arf_xml_parser.arf_xml_parser import ARFXMLParser def get_arf_report_path(src="global_test_data/ssg-fedora-ds-arf.xml"): return str(Path(__file__).parent.parent / src) @pytest.mark.parametrize("rule_id, result", [ ( "xccdf_org.ssgproject.conte...
from pathlib import Path import pytest from oval_graph.arf_xml_parser.arf_xml_parser import ARFXMLParser def get_arf_report_path(src="global_test_data/ssg-fedora-ds-arf.xml"): return str(Path(__file__).parent.parent / src) @pytest.mark.parametrize("rule_id, result", [ ( "xccdf_org.ssgproject.conte...
none
1
2.146882
2
main.py
scottjr632/trump-twitter-bot
0
6651
import os import logging import argparse import sys import signal import subprocess from functools import wraps from dotenv import load_dotenv load_dotenv(verbose=True) from app.config import configure_app from app.bot import TrumpBotScheduler from app.sentimentbot import SentimentBot parser = argparse.ArgumentParse...
import os import logging import argparse import sys import signal import subprocess from functools import wraps from dotenv import load_dotenv load_dotenv(verbose=True) from app.config import configure_app from app.bot import TrumpBotScheduler from app.sentimentbot import SentimentBot parser = argparse.ArgumentParse...
en
0.629455
# this functions initialize the trump bot by getting the latest tweets # and trying to send any tweets that contained errors # requests_path = os.environ.get('REQUESTS_FILE_PATH', 'requests/request.json') # auth_path = os.environ.get('AUTH_FILE_PATH', 'requests/auth.json') # _file_path_sanity_check(requests_path, auth_...
2.13537
2
010-summation-of-primes.py
dendi239/euler
0
6652
#! /usr/bin/env python3 import itertools import typing as tp def primes() -> tp.Generator[int, None, None]: primes_ = [] d = 2 while True: is_prime = True for p in primes_: if p * p > d: break if d % p == 0: is_prime = False ...
#! /usr/bin/env python3 import itertools import typing as tp def primes() -> tp.Generator[int, None, None]: primes_ = [] d = 2 while True: is_prime = True for p in primes_: if p * p > d: break if d % p == 0: is_prime = False ...
fr
0.20845
#! /usr/bin/env python3
3.927169
4
setup.py
letmaik/lensfunpy
94
6653
from setuptools import setup, Extension, find_packages import subprocess import errno import re import os import shutil import sys import zipfile from urllib.request import urlretrieve import numpy from Cython.Build import cythonize isWindows = os.name == 'nt' isMac = sys.platform == 'darwin' is64Bit = sys.maxsize...
from setuptools import setup, Extension, find_packages import subprocess import errno import re import os import shutil import sys import zipfile from urllib.request import urlretrieve import numpy from Cython.Build import cythonize isWindows = os.name == 'nt' isMac = sys.platform == 'darwin' is64Bit = sys.maxsize...
en
0.830365
# adapted from cffi's setup.py # the following may be overridden if pkg-config exists # '-I/usr/...' -> '/usr/...' # old versions of pkg-config don't support this env var, # so here we emulate its effect if needed # this must be after use_pkg_config()! # for version_helper.h # Download cmake to build lensfun # Download...
1.779799
2
chapter_13/mailtools/__init__.py
bimri/programming_python
0
6654
<gh_stars>0 "The mailtools Utility Package" 'Initialization File' """ ################################################################################## mailtools package: interface to mail server transfers, used by pymail2, PyMailGUI, and PyMailCGI; does loads, sends, parsing, composing, and deleting, with part at...
"The mailtools Utility Package" 'Initialization File' """ ################################################################################## mailtools package: interface to mail server transfers, used by pymail2, PyMailGUI, and PyMailCGI; does loads, sends, parsing, composing, and deleting, with part attachments, e...
en
0.81604
################################################################################## mailtools package: interface to mail server transfers, used by pymail2, PyMailGUI, and PyMailCGI; does loads, sends, parsing, composing, and deleting, with part attachments, encodings (of both the email and Unicdode kind), etc.; the p...
1.518433
2
TreeModelLib/BelowgroundCompetition/__init__.py
jvollhueter/pyMANGA-1
0
6655
<reponame>jvollhueter/pyMANGA-1 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 8 15:25:03 2018 @author: bathmann """ from .BelowgroundCompetition import BelowgroundCompetition from .SimpleTest import SimpleTest from .FON import FON from .OGSWithoutFeedback import OGSWithoutFeedback from .OGSLa...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 8 15:25:03 2018 @author: bathmann """ from .BelowgroundCompetition import BelowgroundCompetition from .SimpleTest import SimpleTest from .FON import FON from .OGSWithoutFeedback import OGSWithoutFeedback from .OGSLargeScale3D import OGSLargeScale3...
en
0.576094
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Thu Nov 8 15:25:03 2018 @author: bathmann
1.081602
1
server.py
SDelhey/websocket-chat
0
6656
<reponame>SDelhey/websocket-chat from flask import Flask, render_template from flask_socketio import SocketIO, send, emit app = Flask(__name__) app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app) if __name__ == '__main__': socketio.run(app)
from flask import Flask, render_template from flask_socketio import SocketIO, send, emit app = Flask(__name__) app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app) if __name__ == '__main__': socketio.run(app)
none
1
1.834557
2
services/postprocess/src/postprocess.py
hadarohana/myCosmos
0
6657
""" Post processing on detected objects """ import pymongo from pymongo import MongoClient import time import logging logging.basicConfig(format='%(levelname)s :: %(asctime)s :: %(message)s', level=logging.DEBUG) from joblib import Parallel, delayed import click from xgboost_model.inference import run_inference, Postpr...
""" Post processing on detected objects """ import pymongo from pymongo import MongoClient import time import logging logging.basicConfig(format='%(levelname)s :: %(asctime)s :: %(message)s', level=logging.DEBUG) from joblib import Parallel, delayed import click from xgboost_model.inference import run_inference, Postpr...
en
0.80507
Post processing on detected objects
2.369788
2
model-optimizer/mo/front/common/partial_infer/multi_box_prior_test.py
calvinfeng/openvino
0
6658
<reponame>calvinfeng/openvino """ Copyright (C) 2018-2021 Intel Corporation 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...
""" Copyright (C) 2018-2021 Intel Corporation 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 law or agreed to i...
en
0.84697
Copyright (C) 2018-2021 Intel Corporation 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 law or agreed to in wri...
1.426077
1
bin/mem_monitor.py
Samahu/ros-system-monitor
68
6659
<reponame>Samahu/ros-system-monitor<filename>bin/mem_monitor.py #!/usr/bin/env python ############################################################################ # Copyright (C) 2009, <NAME>, Inc. # # Copyright (C) 2013 by <NAME> # # <EMAIL> ...
#!/usr/bin/env python ############################################################################ # Copyright (C) 2009, <NAME>, Inc. # # Copyright (C) 2013 by <NAME> # # <EMAIL> # # Copyright (C) 2...
en
0.615857
#!/usr/bin/env python ############################################################################ # Copyright (C) 2009, <NAME>, Inc. # # Copyright (C) 2013 by <NAME> # # <EMAIL> # # Copyright (C) 2...
1.073841
1
cmake/utils/gen-ninja-deps.py
stamhe/bitcoin-abc
1,266
6660
<filename>cmake/utils/gen-ninja-deps.py #!/usr/bin/env python3 import argparse import os import subprocess parser = argparse.ArgumentParser(description='Produce a dep file from ninja.') parser.add_argument( '--build-dir', help='The build directory.', required=True) parser.add_argument( '--base-dir', ...
<filename>cmake/utils/gen-ninja-deps.py #!/usr/bin/env python3 import argparse import os import subprocess parser = argparse.ArgumentParser(description='Produce a dep file from ninja.') parser.add_argument( '--build-dir', help='The build directory.', required=True) parser.add_argument( '--base-dir', ...
en
0.772775
#!/usr/bin/env python3 # Make sure we operate in the right folder. # Construct the set of all targets # We have a new target ninja has 3 types of input: 1. Explicit dependencies, no prefix; 2. Implicit dependencies, | prefix. 3. Order only dependencies, || prefix. ...
2.346864
2
src/webpy1/src/manage/checkPic.py
ptphp/PyLib
1
6661
<gh_stars>1-10 ''' Created on 2011-6-22 @author: dholer '''
''' Created on 2011-6-22 @author: dholer '''
en
0.667413
Created on 2011-6-22 @author: dholer
1.215772
1
tests/__init__.py
coleb/sendoff
2
6662
"""Tests for the `sendoff` library.""" """ The `sendoff` library tests validate the expected function of the library. """
"""Tests for the `sendoff` library.""" """ The `sendoff` library tests validate the expected function of the library. """
en
0.811925
Tests for the `sendoff` library. The `sendoff` library tests validate the expected function of the library.
0.891268
1
sysinv/sysinv/sysinv/sysinv/helm/garbd.py
Wind-River/starlingx-config
0
6663
# # Copyright (c) 2018-2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from sysinv.common import constants from sysinv.common import exception from sysinv.common import utils from sysinv.helm import common from sysinv.helm import base class GarbdHelm(base.BaseHelm): """Class to encapsulat...
# # Copyright (c) 2018-2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from sysinv.common import constants from sysinv.common import exception from sysinv.common import utils from sysinv.helm import common from sysinv.helm import base class GarbdHelm(base.BaseHelm): """Class to encapsulat...
en
0.885163
# # Copyright (c) 2018-2019 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # Class to encapsulate helm operations for the galera arbitrator chart # The service name is used to build the standard docker image location. # It is intentionally "mariadb" and not "garbd" as they both use the # same docker i...
1.830922
2
dataloader/frame_counter/frame_counter.py
aaron-zou/pretraining-twostream
0
6664
#!/usr/bin/env python """Generate frame counts dict for a dataset. Usage: frame_counter.py [options] Options: -h, --help Print help message --root=<str> Path to root of dataset (should contain video folders that contain images) [default: /vision/vision_users/azou/data/hmdb5...
#!/usr/bin/env python """Generate frame counts dict for a dataset. Usage: frame_counter.py [options] Options: -h, --help Print help message --root=<str> Path to root of dataset (should contain video folders that contain images) [default: /vision/vision_users/azou/data/hmdb5...
en
0.519071
#!/usr/bin/env python Generate frame counts dict for a dataset. Usage: frame_counter.py [options] Options: -h, --help Print help message --root=<str> Path to root of dataset (should contain video folders that contain images) [default: /vision/vision_users/azou/data/hmdb51_f...
3.094634
3
Problem_30/main.py
jdalzatec/EulerProject
1
6665
total = 0 for n in range(1000, 1000000): suma = 0 for i in str(n): suma += int(i)**5 if (n == suma): total += n print(total)
total = 0 for n in range(1000, 1000000): suma = 0 for i in str(n): suma += int(i)**5 if (n == suma): total += n print(total)
none
1
3.506716
4
armi/physics/fuelCycle/settings.py
celikten/armi
1
6666
<gh_stars>1-10 """Settings for generic fuel cycle code.""" import re import os from armi.settings import setting from armi.operators import settingsValidation CONF_ASSEMBLY_ROTATION_ALG = "assemblyRotationAlgorithm" CONF_ASSEM_ROTATION_STATIONARY = "assemblyRotationStationary" CONF_CIRCULAR_RING_MODE = "circularRingM...
"""Settings for generic fuel cycle code.""" import re import os from armi.settings import setting from armi.operators import settingsValidation CONF_ASSEMBLY_ROTATION_ALG = "assemblyRotationAlgorithm" CONF_ASSEM_ROTATION_STATIONARY = "assemblyRotationStationary" CONF_CIRCULAR_RING_MODE = "circularRingMode" CONF_CIRCU...
en
0.721764
Settings for generic fuel cycle code. Define settings for fuel cycle. # schema here could check if file exists, but this is a bit constraining in testing. # For example, some tests have relative paths for this but aren't running in # the right directory, and IsFile doesn't seem to work well with relative paths. # This ...
2.588758
3
nl/predictor.py
jclosure/donkus
1
6667
<gh_stars>1-10 from nltk.corpus import gutenberg from nltk import ConditionalFreqDist from random import choice #create the distribution object cfd = ConditionalFreqDist() ## for each token count the current word given the previous word prev_word = None for word in gutenberg.words('austen-persuasion.txt'): cfd[p...
from nltk.corpus import gutenberg from nltk import ConditionalFreqDist from random import choice #create the distribution object cfd = ConditionalFreqDist() ## for each token count the current word given the previous word prev_word = None for word in gutenberg.words('austen-persuasion.txt'): cfd[prev_word][word] ...
en
0.792464
#create the distribution object ## for each token count the current word given the previous word ## start predicting at given word, say "therefore" ## find all words that can follow the given word and choose one at random
3.634085
4
eve/workers/pykmip/bin/run_server.py
mmg-3/cloudserver
762
6668
#!/usr/bin/env python # Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory # All Rights Reserved. # # 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.ap...
#!/usr/bin/env python # Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory # All Rights Reserved. # # 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.ap...
en
0.808251
#!/usr/bin/env python # Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory # All Rights Reserved. # # 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.apa...
1.935179
2
tests/test_tempo_event.py
yokaze/crest-python
0
6669
# # test_tempo_event.py # crest-python # # Copyright (C) 2017 <NAME> # Distributed under the MIT License. # import crest_loader import unittest from crest.events.meta import TempoEvent class TestTempoEvent(unittest.TestCase): def test_ctor(self): TempoEvent() TempoEvent(120) def test_...
# # test_tempo_event.py # crest-python # # Copyright (C) 2017 <NAME> # Distributed under the MIT License. # import crest_loader import unittest from crest.events.meta import TempoEvent class TestTempoEvent(unittest.TestCase): def test_ctor(self): TempoEvent() TempoEvent(120) def test_...
en
0.466933
# # test_tempo_event.py # crest-python # # Copyright (C) 2017 <NAME> # Distributed under the MIT License. #
2.422533
2
tensorflow_quantum/python/differentiators/__init__.py
PyJedi/quantum
1,501
6670
<gh_stars>1000+ # Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. # # 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 # # Un...
# Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. # # 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...
en
0.793357
# Copyright 2020 The TensorFlow Quantum Authors. All Rights Reserved. # # 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...
1.828433
2
tests/test_color_background.py
erykoff/redmapper
17
6671
<reponame>erykoff/redmapper import unittest import numpy.testing as testing import numpy as np import fitsio import tempfile import os from redmapper import ColorBackground from redmapper import ColorBackgroundGenerator from redmapper import Configuration class ColorBackgroundTestCase(unittest.TestCase): """ ...
import unittest import numpy.testing as testing import numpy as np import fitsio import tempfile import os from redmapper import ColorBackground from redmapper import ColorBackgroundGenerator from redmapper import Configuration class ColorBackgroundTestCase(unittest.TestCase): """ Tests for the redmapper.Colo...
en
0.733658
Tests for the redmapper.ColorBackground and redmapper.ColorBackgroundGenerator classes. Run the ColorBackground and ColorBackgroundGenerator tests. # These are new values that are based on improvements in the binning. # Test color1 # Test color2 # Test off-diagonal # And a test sigma_g with the usehdrarea=True # Te...
2.520081
3
src/metpy/calc/basic.py
Exi666/MetPy
0
6672
# Copyright (c) 2008,2015,2016,2017,2018,2019 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Contains a collection of basic calculations. These include: * wind components * heat index * windchill """ import warnings import numpy as np from scip...
# Copyright (c) 2008,2015,2016,2017,2018,2019 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Contains a collection of basic calculations. These include: * wind components * heat index * windchill """ import warnings import numpy as np from scip...
en
0.737979
# Copyright (c) 2008,2015,2016,2017,2018,2019 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause Contains a collection of basic calculations. These include: * wind components * heat index * windchill # The following variables are constants for a standa...
3.223434
3
burl/core/api/views.py
wryfi/burl
1
6673
from rest_framework.response import Response from rest_framework.decorators import api_view from rest_framework.reverse import reverse from rest_framework_simplejwt.tokens import RefreshToken @api_view(['GET']) def root(request, fmt=None): return Response({ 'v1': reverse('api_v1:root', request=request, fo...
from rest_framework.response import Response from rest_framework.decorators import api_view from rest_framework.reverse import reverse from rest_framework_simplejwt.tokens import RefreshToken @api_view(['GET']) def root(request, fmt=None): return Response({ 'v1': reverse('api_v1:root', request=request, fo...
none
1
2.38004
2
ITmeetups_back/api/serializers.py
RomulusGwelt/AngularProject
3
6674
from rest_framework import serializers from .models import Post, Comment, Like from django.contrib.auth.models import User class CurrentUserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id', 'username', 'email') class PostSerializer(serializers.ModelSerializer): ...
from rest_framework import serializers from .models import Post, Comment, Like from django.contrib.auth.models import User class CurrentUserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id', 'username', 'email') class PostSerializer(serializers.ModelSerializer): ...
none
1
2.333708
2
qurator/sbb_ned/embeddings/bert.py
qurator-spk/sbb_ned
6
6675
<reponame>qurator-spk/sbb_ned from ..embeddings.base import Embeddings from flair.data import Sentence class BertEmbeddings(Embeddings): def __init__(self, model_path, layers="-1, -2, -3, -4", pooling_operation='first', use_scalar_mix=True, no_cuda=False, *args, **kwargs): super(BertEm...
from ..embeddings.base import Embeddings from flair.data import Sentence class BertEmbeddings(Embeddings): def __init__(self, model_path, layers="-1, -2, -3, -4", pooling_operation='first', use_scalar_mix=True, no_cuda=False, *args, **kwargs): super(BertEmbeddings, self).__init__(*args...
en
0.460624
# noinspection PyUnresolvedReferences
2.239249
2
Arbitrage_Future/Arbitrage_Future/test.py
ronaldzgithub/CryptoArbitrage
1
6676
<reponame>ronaldzgithub/CryptoArbitrage<filename>Arbitrage_Future/Arbitrage_Future/test.py # !/usr/local/bin/python # -*- coding:utf-8 -*- import YunBi import CNBTC import json import threading import Queue import time import logging import numpy import message import random open_platform = [True,True,True,True] numpy....
# !/usr/local/bin/python # -*- coding:utf-8 -*- import YunBi import CNBTC import json import threading import Queue import time import logging import numpy import message import random open_platform = [True,True,True,True] numpy.set_printoptions(suppress=True) # logging.basicConfig(level=logging.DEBUG, # ...
en
0.356918
# !/usr/local/bin/python # -*- coding:utf-8 -*- # logging.basicConfig(level=logging.DEBUG, # format="[%(asctime)20s] [%(levelname)8s] %(filename)10s:%(lineno)-5s --- %(message)s", # datefmt="%Y-%m-%d %H:%M:%S", # filename="log/%s.log"%time.strftime('%Y-%m-%d %H:%M:%S',tim...
2.028152
2
startuptweet.py
cudmore/startupnotify
0
6677
#!/usr/bin/python3 """ Author: <NAME> Date: 20181013 Purpose: Send a Tweet with IP and MAC address of a Raspberry Pi Install: pip3 install tweepy Usage: python3 startuptweet.py 'this is my tweet' """ import tweepy import sys import socket import subprocess from uuid import getnode as get_mac from datetime import da...
#!/usr/bin/python3 """ Author: <NAME> Date: 20181013 Purpose: Send a Tweet with IP and MAC address of a Raspberry Pi Install: pip3 install tweepy Usage: python3 startuptweet.py 'this is my tweet' """ import tweepy import sys import socket import subprocess from uuid import getnode as get_mac from datetime import da...
en
0.618688
#!/usr/bin/python3 Author: <NAME> Date: 20181013 Purpose: Send a Tweet with IP and MAC address of a Raspberry Pi Install: pip3 install tweepy Usage: python3 startuptweet.py 'this is my tweet' # Create variables for each key, secret, token # Set up OAuth and integrate with API #
3.36744
3
distributed/db.py
VW-Stephen/pySpiderScrape
0
6678
#!/usr/bin/python from bs4 import BeautifulSoup import sqlite3 class DB: """ Abstraction for the profile database """ def __init__(self, filename): """ Creates a new connection to the database filename - The name of the database file to use """ self.Filename = ...
#!/usr/bin/python from bs4 import BeautifulSoup import sqlite3 class DB: """ Abstraction for the profile database """ def __init__(self, filename): """ Creates a new connection to the database filename - The name of the database file to use """ self.Filename = ...
en
0.545645
#!/usr/bin/python Abstraction for the profile database Creates a new connection to the database filename - The name of the database file to use Saves the profile to the database data - A dictionary of profile information Returns true if the given URL is in the database, false otherwise url - ...
3.380414
3
private/scripts/recheck-invalid-handles.py
bansal-shubham/stopstalk-deployment
0
6679
""" Copyright (c) 2015-2019 <NAME>(<EMAIL>), StopStalk 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...
""" Copyright (c) 2015-2019 <NAME>(<EMAIL>), StopStalk 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...
en
0.74144
Copyright (c) 2015-2019 <NAME>(<EMAIL>), StopStalk 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...
1.913549
2
onnxmltools/convert/keras/_parse.py
gpminsuk/onnxmltools
1
6680
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import te...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import te...
en
0.772759
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- # keras_sh...
2.419569
2
src/scenic/core/regions.py
cahartsell/Scenic
0
6681
"""Objects representing regions in space.""" import math import random import itertools import numpy import scipy.spatial import shapely.geometry import shapely.ops from scenic.core.distributions import Samplable, RejectionException, needsSampling from scenic.core.lazy_eval import valueInContext from scenic.core.vec...
"""Objects representing regions in space.""" import math import random import itertools import numpy import scipy.spatial import shapely.geometry import shapely.ops from scenic.core.distributions import Samplable, RejectionException, needsSampling from scenic.core.lazy_eval import valueInContext from scenic.core.vec...
en
0.796529
Objects representing regions in space. Build a 'Region' from Shapely geometry. Uniform distribution over points in a Region Abstract class for regions. Get a `Region` representing the intersection of this one with another. Get a uniform `Distribution` over points in a `Region`. Sample a uniformly-random point in this `...
2.341234
2
orangery/cli/cutfill.py
mrahnis/orangery
2
6682
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import logging import time import json import click import matplotlib.pyplot as plt import orangery as o from orangery.cli import defaults, util from orangery.tools.plotting import get_scale_factor @click.command(options_metavar='<options>') @click.argument(...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import logging import time import json import click import matplotlib.pyplot as plt import orangery as o from orangery.cli import defaults, util from orangery.tools.plotting import get_scale_factor @click.command(options_metavar='<options>') @click.argument(...
en
0.658687
#!/usr/bin/env python # -*- coding: utf-8 -*- # help="survey representing the initial condition" # help="survey representing the final condition" # help="character string identifying the columns" # help="name of the cross-section to plot" Displays a plot of a repeat survey with cut and fill. \b The cutfill sub...
2.487014
2
src/ice_g2p/dictionaries.py
cadia-lvl/ice-g2p
0
6683
import os, sys DICTIONARY_FILE = os.path.join(sys.prefix, 'dictionaries/ice_pron_dict_standard_clear.csv') HEAD_FILE = os.path.join(sys.prefix, 'data/head_map.csv') MODIFIER_FILE = os.path.join(sys.prefix, 'data/modifier_map.csv') VOWELS_FILE = os.path.join(sys.prefix, 'data/vowels_sampa.txt') CONS_CLUSTERS_FILE = os.p...
import os, sys DICTIONARY_FILE = os.path.join(sys.prefix, 'dictionaries/ice_pron_dict_standard_clear.csv') HEAD_FILE = os.path.join(sys.prefix, 'data/head_map.csv') MODIFIER_FILE = os.path.join(sys.prefix, 'data/modifier_map.csv') VOWELS_FILE = os.path.join(sys.prefix, 'data/vowels_sampa.txt') CONS_CLUSTERS_FILE = os.p...
none
1
3.110037
3
tests/test_annotations_notebook.py
jeromedockes/pylabelbuddy
0
6684
from pylabelbuddy import _annotations_notebook def test_annotations_notebook(root, annotations_mock, dataset_mock): nb = _annotations_notebook.AnnotationsNotebook( root, annotations_mock, dataset_mock ) nb.change_database() assert nb.notebook.index(nb.notebook.select()) == 2 nb.go_to_annot...
from pylabelbuddy import _annotations_notebook def test_annotations_notebook(root, annotations_mock, dataset_mock): nb = _annotations_notebook.AnnotationsNotebook( root, annotations_mock, dataset_mock ) nb.change_database() assert nb.notebook.index(nb.notebook.select()) == 2 nb.go_to_annot...
none
1
1.794908
2
py/solns/wordSearch/wordSearch.py
zcemycl/algoTest
1
6685
<reponame>zcemycl/algoTest class Solution: @staticmethod def naive(board,word): rows,cols,n = len(board),len(board[0]),len(word) visited = set() def dfs(i,j,k): idf = str(i)+','+str(j) if i<0 or j<0 or i>cols-1 or j>rows-1 or \ board[j][i]!=word[k]...
class Solution: @staticmethod def naive(board,word): rows,cols,n = len(board),len(board[0]),len(word) visited = set() def dfs(i,j,k): idf = str(i)+','+str(j) if i<0 or j<0 or i>cols-1 or j>rows-1 or \ board[j][i]!=word[k] or idf in visited: ...
en
0.849192
Improve by, 1. Exclude set which stores visited coordinates, and use #. 2. No indicing in original word. 3. Quick exit for 4 directions.
3.491974
3
middleware/run.py
natedogg484/react-flask-authentication
0
6686
<reponame>natedogg484/react-flask-authentication from flask import Flask from flask_cors import CORS from flask_restful import Api from flask_sqlalchemy import SQLAlchemy from flask_jwt_extended import JWTManager app = Flask(__name__) CORS(app) api = Api(app) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.d...
from flask import Flask from flask_cors import CORS from flask_restful import Api from flask_sqlalchemy import SQLAlchemy from flask_jwt_extended import JWTManager app = Flask(__name__) CORS(app) api = Api(app) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] =...
none
1
2.319721
2
Programas do Curso/Desafio 2.py
carvalhopedro22/Programas-em-python-cursos-e-geral-
0
6687
<filename>Programas do Curso/Desafio 2.py nome = input('Qual o seu nome? ') dia = input('Que dia do mês você nasceu? ') mes = input('Qual o mês em que você nasceu? ') ano = input('Qual o ano em que você nasceu? ') print(nome, 'nasceu em', dia,'de',mes,'do ano',ano)
<filename>Programas do Curso/Desafio 2.py nome = input('Qual o seu nome? ') dia = input('Que dia do mês você nasceu? ') mes = input('Qual o mês em que você nasceu? ') ano = input('Qual o ano em que você nasceu? ') print(nome, 'nasceu em', dia,'de',mes,'do ano',ano)
none
1
4.159191
4
cmibs/cisco_vlan_membership_mib.py
prorevizor/noc
84
6688
# ---------------------------------------------------------------------- # CISCO-VLAN-MEMBERSHIP-MIB # Compiled MIB # Do not modify this file directly # Run ./noc mib make-cmib instead # ---------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for de...
# ---------------------------------------------------------------------- # CISCO-VLAN-MEMBERSHIP-MIB # Compiled MIB # Do not modify this file directly # Run ./noc mib make-cmib instead # ---------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for de...
en
0.298942
# ---------------------------------------------------------------------- # CISCO-VLAN-MEMBERSHIP-MIB # Compiled MIB # Do not modify this file directly # Run ./noc mib make-cmib instead # ---------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for de...
1.506396
2
harbor/tests/test_unit.py
tdimnet/integrations-core
663
6689
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import pytest from mock import MagicMock from requests import HTTPError from datadog_checks.base import AgentCheck from datadog_checks.dev.http import MockResponse from .common import HARBOR_COMPONENTS, ...
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import pytest from mock import MagicMock from requests import HTTPError from datadog_checks.base import AgentCheck from datadog_checks.dev.http import MockResponse from .common import HARBOR_COMPONENTS, ...
en
0.752799
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE)
1.999443
2
M-SPRING/template/adapter.py
CN-UPB/SPRING
3
6690
# module for adapting templates on the fly if components are reused # check that all reused components are defined consistently -> else: exception def check_consistency(components): for j1 in components: for j2 in components: # compare all components if j1 == j2 and j1.__dict__ != j2.__dict__: # same n...
# module for adapting templates on the fly if components are reused # check that all reused components are defined consistently -> else: exception def check_consistency(components): for j1 in components: for j2 in components: # compare all components if j1 == j2 and j1.__dict__ != j2.__dict__: # same n...
en
0.796116
# module for adapting templates on the fly if components are reused # check that all reused components are defined consistently -> else: exception # compare all components # same name and reuseID but different other attributes # check and return number of reuses # count number of reuses for each port # set => no duplic...
2.73782
3
column_completer.py
AllanLRH/column_completer
0
6691
<reponame>AllanLRH/column_completer class ColumnCompleter(object): """Complete Pandas DataFrame column names""" def __init__(self, df, space_filler='_', silence_warnings=False): """ Once instantiated with a Pandas DataFrame, it will expose the column names as attributes which maps to t...
class ColumnCompleter(object): """Complete Pandas DataFrame column names""" def __init__(self, df, space_filler='_', silence_warnings=False): """ Once instantiated with a Pandas DataFrame, it will expose the column names as attributes which maps to their string counterparts. Au...
en
0.748636
Complete Pandas DataFrame column names Once instantiated with a Pandas DataFrame, it will expose the column names as attributes which maps to their string counterparts. Autocompletion is supported. Spaces in the column names are by default replaced with underscores, though it still map...
3.692041
4
source/vsm-dashboard/vsm_dashboard/test/test_data/swift_data.py
ramkrsna/virtual-storage-manager
172
6692
# Copyright 2012 Nebula, 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 law or agree...
# Copyright 2012 Nebula, 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 law or agree...
en
0.851533
# Copyright 2012 Nebula, 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 law or agree...
1.728146
2
cinder/backup/driver.py
liangintel/stx-cinder
0
6693
# Copyright (C) 2013 Deutsche Telekom AG # All Rights Reserved. # # 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 r...
# Copyright (C) 2013 Deutsche Telekom AG # All Rights Reserved. # # 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 r...
en
0.842494
# Copyright (C) 2013 Deutsche Telekom AG # All Rights Reserved. # # 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 r...
1.566643
2
__init__.py
ENDERZOMBI102/chained
0
6694
<reponame>ENDERZOMBI102/chained<filename>__init__.py<gh_stars>0 from .chainOpen import chainOpen __all__ = [ 'chainOpen' ]
from .chainOpen import chainOpen __all__ = [ 'chainOpen' ]
none
1
1.097328
1
code/reasoningtool/tests/QuerySciGraphTests.py
andrewsu/RTX
31
6695
import unittest from QuerySciGraph import QuerySciGraph class QuerySciGraphTestCase(unittest.TestCase): def test_get_disont_ids_for_mesh_id(self): disont_ids = QuerySciGraph.get_disont_ids_for_mesh_id('MESH:D005199') known_ids = {'DOID:13636'} self.assertSetEqual(disont_ids, known_ids) ...
import unittest from QuerySciGraph import QuerySciGraph class QuerySciGraphTestCase(unittest.TestCase): def test_get_disont_ids_for_mesh_id(self): disont_ids = QuerySciGraph.get_disont_ids_for_mesh_id('MESH:D005199') known_ids = {'DOID:13636'} self.assertSetEqual(disont_ids, known_ids) ...
en
0.729297
# Renal cyst
2.750969
3
ledis/cli.py
gianghta/Ledis
0
6696
from typing import Any from ledis import Ledis from ledis.exceptions import InvalidUsage class CLI: __slots__ = {"ledis", "commands"} def __init__(self): self.ledis = Ledis() self.commands = { "set": self.ledis.set, "get": self.ledis.get, "sadd": self.ledi...
from typing import Any from ledis import Ledis from ledis.exceptions import InvalidUsage class CLI: __slots__ = {"ledis", "commands"} def __init__(self): self.ledis = Ledis() self.commands = { "set": self.ledis.set, "get": self.ledis.get, "sadd": self.ledi...
none
1
2.833198
3
ClosedLoopTF.py
nazhanshaberi/miniature-octo-barnacle
0
6697
#group 1: Question 1(b) # A control system for positioning the head of a laser printer has the closed loop transfer function: # !pip install control import matplotlib.pyplot as plt import control a=10 #Value for a b=50 #value for b sys1 = control.tf(20*b,[1,20+a,b+20*a,20*b]) print('3rd order system transfer funct...
#group 1: Question 1(b) # A control system for positioning the head of a laser printer has the closed loop transfer function: # !pip install control import matplotlib.pyplot as plt import control a=10 #Value for a b=50 #value for b sys1 = control.tf(20*b,[1,20+a,b+20*a,20*b]) print('3rd order system transfer funct...
en
0.877911
#group 1: Question 1(b) # A control system for positioning the head of a laser printer has the closed loop transfer function: # !pip install control #Value for a #value for b
3.720527
4
example_project/test_messages/bbcode_tags.py
bastiedotorg/django-precise-bbcode
30
6698
import re from precise_bbcode.bbcode.tag import BBCodeTag from precise_bbcode.tag_pool import tag_pool color_re = re.compile(r'^([a-z]+|#[0-9abcdefABCDEF]{3,6})$') class SubTag(BBCodeTag): name = 'sub' def render(self, value, option=None, parent=None): return '<sub>%s</sub>' % value class PreTag...
import re from precise_bbcode.bbcode.tag import BBCodeTag from precise_bbcode.tag_pool import tag_pool color_re = re.compile(r'^([a-z]+|#[0-9abcdefABCDEF]{3,6})$') class SubTag(BBCodeTag): name = 'sub' def render(self, value, option=None, parent=None): return '<sub>%s</sub>' % value class PreTag...
es
0.155237
#[0-9abcdefABCDEF]{3,6})$')
2.52923
3
tests/test_vmtkScripts/test_vmtksurfacescaling.py
ramtingh/vmtk
0
6699
## Program: VMTK ## Language: Python ## Date: January 10, 2018 ## Version: 1.4 ## Copyright (c) <NAME>, <NAME>, All rights reserved. ## See LICENSE file for details. ## This software is distributed WITHOUT ANY WARRANTY; without even ## the implied warranty of MERCHANTABILITY or FITNESS FOR A PAR...
## Program: VMTK ## Language: Python ## Date: January 10, 2018 ## Version: 1.4 ## Copyright (c) <NAME>, <NAME>, All rights reserved. ## See LICENSE file for details. ## This software is distributed WITHOUT ANY WARRANTY; without even ## the implied warranty of MERCHANTABILITY or FITNESS FOR A PAR...
en
0.814378
## Program: VMTK ## Language: Python ## Date: January 10, 2018 ## Version: 1.4 ## Copyright (c) <NAME>, <NAME>, All rights reserved. ## See LICENSE file for details. ## This software is distributed WITHOUT ANY WARRANTY; without even ## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTI...
2.000571
2