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
testing/conftest.py
davidszotten/pdbpp
0
4300
import functools import sys from contextlib import contextmanager import pytest _orig_trace = None def pytest_configure(): global _orig_trace _orig_trace = sys.gettrace() @pytest.fixture(scope="session", autouse=True) def term(): """Configure TERM for predictable output from Pygments.""" from _pyt...
import functools import sys from contextlib import contextmanager import pytest _orig_trace = None def pytest_configure(): global _orig_trace _orig_trace = sys.gettrace() @pytest.fixture(scope="session", autouse=True) def term(): """Configure TERM for predictable output from Pygments.""" from _pyt...
en
0.828695
Configure TERM for predictable output from Pygments. # if _orig_trace and not hasattr(sys, "pypy_version_info"): # Fails with PyPy2 (https://travis-ci.org/antocuni/pdb/jobs/509624590)?! (Re)store sys.gettrace after test run. This is required to re-enable coverage tracking. # Wrap sys.settrace to restore original t...
2.072019
2
thing_gym_ros/envs/utils.py
utiasSTARS/thing-gym-ros
1
4301
<gh_stars>1-10 """ Various generic env utilties. """ def center_crop_img(img, crop_zoom): """ crop_zoom is amount to "zoom" into the image. E.g. 2.0 would cut out half of the width, half of the height, and only give the center. """ raw_height, raw_width = img.shape[:2] center = raw_height // 2, raw_wid...
""" Various generic env utilties. """ def center_crop_img(img, crop_zoom): """ crop_zoom is amount to "zoom" into the image. E.g. 2.0 would cut out half of the width, half of the height, and only give the center. """ raw_height, raw_width = img.shape[:2] center = raw_height // 2, raw_width // 2 cro...
en
0.873383
Various generic env utilties. crop_zoom is amount to "zoom" into the image. E.g. 2.0 would cut out half of the width, half of the height, and only give the center. relative_corners are floats between 0 and 1 designating where the corners of a crop box should be ([[top_left_x, top_left_y], [bottom_right_x, botto...
3.481885
3
tests/sentry/utils/http/tests.py
arya-s/sentry
1
4302
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import absolute_import import mock from exam import fixture from sentry import options from sentry.models import Project from sentry.testutils import TestCase from sentry.utils.http import ( is_same_domain, is_valid_origin, get_origins, absolute_uri, is_val...
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from exam import fixture from sentry import options from sentry.models import Project from sentry.testutils import TestCase from sentry.utils.http import ( is_same_domain, is_valid_origin, get_origins, absolute_uri, is_valid_ip, ) clas...
en
0.769321
# -*- coding: utf-8 -*-
2.21567
2
comcenterproject/project/helpers.py
tongpa/bantak_program
0
4303
<gh_stars>0 # -*- coding: utf-8 -*- """WebHelpers used in project.""" #from webhelpers import date, feedgenerator, html, number, misc, text from markupsafe import Markup def bold(text): return Markup('<strong>%s</strong>' % text)
# -*- coding: utf-8 -*- """WebHelpers used in project.""" #from webhelpers import date, feedgenerator, html, number, misc, text from markupsafe import Markup def bold(text): return Markup('<strong>%s</strong>' % text)
en
0.56595
# -*- coding: utf-8 -*- WebHelpers used in project. #from webhelpers import date, feedgenerator, html, number, misc, text
1.947077
2
Thesis/load/runRiakLoads.py
arnaudsjs/YCSB-1
0
4304
import sys; from Thesis.load.loadBenchmark import runLoadBenchmarkAsBatch; from Thesis.cluster.RiakCluster import RiakCluster; NORMAL_BINDING = 'riak'; CONSISTENCY_BINDING = 'riak_consistency'; IPS_IN_CLUSTER = ['172.16.33.14', '172.16.33.15', '172.16.33.16', '172.16.33.17', '172.16.33.18']; def main(): if len(s...
import sys; from Thesis.load.loadBenchmark import runLoadBenchmarkAsBatch; from Thesis.cluster.RiakCluster import RiakCluster; NORMAL_BINDING = 'riak'; CONSISTENCY_BINDING = 'riak_consistency'; IPS_IN_CLUSTER = ['172.16.33.14', '172.16.33.15', '172.16.33.16', '172.16.33.17', '172.16.33.18']; def main(): if len(s...
en
0.444817
#ops> <list of #threads> <list of #machines> [<list remote ycsb nodes>]'; # main();
2.060838
2
auto_nag/tests/test_round_robin.py
Mozilla-GitHub-Standards/f9c78643f5862cda82001d4471255ac29ef0c6b2c6171e2c1cbecab3d2fef4dd
0
4305
# coding: utf-8 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from mock import patch from auto_nag.people import People from auto_nag.round_robin im...
# coding: utf-8 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from mock import patch from auto_nag.people import People from auto_nag.round_robin im...
en
0.914534
# coding: utf-8 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/.
2.234984
2
scipy/weave/inline_tools.py
tacaswell/scipy
1
4306
# should re-write compiled functions to take a local and global dict # as input. from __future__ import absolute_import, print_function import sys import os from . import ext_tools from . import catalog from . import common_info from numpy.core.multiarray import _get_ndarray_c_version ndarray_api_version = '/* NDARRA...
# should re-write compiled functions to take a local and global dict # as input. from __future__ import absolute_import, print_function import sys import os from . import ext_tools from . import catalog from . import common_info from numpy.core.multiarray import _get_ndarray_c_version ndarray_api_version = '/* NDARRA...
en
0.791929
# should re-write compiled functions to take a local and global dict # as input. # not an easy way for the user_path_list to come in here. # the PYTHONCOMPILED environment variable offers the most hope. # Some specialization is needed for inline extension functions Create code block for PyArg_ParseTuple. Variable decl...
2.288899
2
trove/guestagent/common/configuration.py
sapcc/trove
1
4307
<reponame>sapcc/trove # Copyright 2015 Tesora Inc. # 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 # # ...
# Copyright 2015 Tesora Inc. # 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 a...
en
0.732994
# Copyright 2015 Tesora Inc. # 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 a...
1.986843
2
API-Reference-Code-Generator.py
sawyercade/Documentation
116
4308
import pathlib import yaml documentations = {"Our Platform": "QuantConnect-Platform-2.0.0.yaml", "Alpha Streams": "QuantConnect-Alpha-0.8.yaml"} def RequestTable(api_call, params): writeUp = '<table class="table qc-table">\n<thead>\n<tr>\n' writeUp += f'<th colspan="2"><code>{api_call}</code...
import pathlib import yaml documentations = {"Our Platform": "QuantConnect-Platform-2.0.0.yaml", "Alpha Streams": "QuantConnect-Alpha-0.8.yaml"} def RequestTable(api_call, params): writeUp = '<table class="table qc-table">\n<thead>\n<tr>\n' writeUp += f'<th colspan="2"><code>{api_call}</code...
en
0.673371
# Create path if not exist # Create Introduction part # Create Description part if having one # Create Request part # Create Response part
2.298497
2
forge_api_client/hubs.py
dmh126/forge-python-data-management-api
1
4309
from .utils import get_request, authorized class Hubs: @authorized def getHubs(self): url = self.api_url + '/project/v1/hubs' headers = { 'Authorization': '%s %s' % (self.token_type, self.access_token) } return get_request(url, headers) @authorized def g...
from .utils import get_request, authorized class Hubs: @authorized def getHubs(self): url = self.api_url + '/project/v1/hubs' headers = { 'Authorization': '%s %s' % (self.token_type, self.access_token) } return get_request(url, headers) @authorized def g...
none
1
2.565127
3
tlp/django_app/app/urls.py
munisisazade/create-django-app
14
4310
from django.conf.urls import url # from .views import BaseIndexView urlpatterns = [ # url(r'^$', BaseIndexView.as_view(), name="index"), ]
from django.conf.urls import url # from .views import BaseIndexView urlpatterns = [ # url(r'^$', BaseIndexView.as_view(), name="index"), ]
en
0.39847
# from .views import BaseIndexView # url(r'^$', BaseIndexView.as_view(), name="index"),
1.4421
1
tools/archive/create_loadable_configs.py
madelinemccombe/iron-skillet
0
4311
<gh_stars>0 # Copyright (c) 2018, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTH...
# Copyright (c) 2018, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
en
0.687174
# Copyright (c) 2018, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
2.229452
2
pactman/verifier/pytest_plugin.py
piotrantosz/pactman
67
4312
import glob import logging import os import warnings import pytest from _pytest.outcomes import Failed from _pytest.reports import TestReport from .broker_pact import BrokerPact, BrokerPacts, PactBrokerConfig from .result import PytestResult, log def pytest_addoption(parser): group = parser.getgroup("pact speci...
import glob import logging import os import warnings import pytest from _pytest.outcomes import Failed from _pytest.reports import TestReport from .broker_pact import BrokerPact, BrokerPacts, PactBrokerConfig from .result import PytestResult, log def pytest_addoption(parser): group = parser.getgroup("pact speci...
en
0.743702
# Future options to be implemented. Listing them here so naming consistency can be a thing. # group.addoption("--pact-publish-pacts", action="store_true", default=False, # help="publish pacts to pact broker") # group.addoption("--pact-consumer-version", default=None, # help="...
2.134528
2
interface/docstring.py
karttur/geoimagine02-grass
0
4313
# -*- coding: utf-8 -*- def docstring_property(class_doc): """Property attribute for docstrings. Took from: https://gist.github.com/bfroehle/4041015 >>> class A(object): ... '''Main docstring''' ... def __init__(self, x): ... self.x = x ... @docstring_property(__doc__)...
# -*- coding: utf-8 -*- def docstring_property(class_doc): """Property attribute for docstrings. Took from: https://gist.github.com/bfroehle/4041015 >>> class A(object): ... '''Main docstring''' ... def __init__(self, x): ... self.x = x ... @docstring_property(__doc__)...
en
0.67265
# -*- coding: utf-8 -*- Property attribute for docstrings. Took from: https://gist.github.com/bfroehle/4041015 >>> class A(object): ... '''Main docstring''' ... def __init__(self, x): ... self.x = x ... @docstring_property(__doc__) ... def __doc__(self): ... ...
2.758872
3
autocnet/matcher/cuda_matcher.py
gsn9/autocnet
0
4314
<reponame>gsn9/autocnet import warnings try: import cudasift as cs except: cs = None import numpy as np import pandas as pd def match(edge, aidx=None, bidx=None, **kwargs): """ Apply a composite CUDA matcher and ratio check. If this method is used, no additional ratio check is necessary and no ...
import warnings try: import cudasift as cs except: cs = None import numpy as np import pandas as pd def match(edge, aidx=None, bidx=None, **kwargs): """ Apply a composite CUDA matcher and ratio check. If this method is used, no additional ratio check is necessary and no symmetry check is requir...
en
0.898868
Apply a composite CUDA matcher and ratio check. If this method is used, no additional ratio check is necessary and no symmetry check is required. The ratio check is embedded on the cuda side and returned as an ambiguity value. In testing symmetry is not required as it is expensive without significant ...
2.01894
2
app/apis/__init__.py
FabienArcellier/blueprint-webapp-flask-restx
0
4315
from flask_restx import Api from app.apis.hello import api as hello api = Api( title='api', version='1.0', description='', prefix='/api', doc='/api' ) api.add_namespace(hello)
from flask_restx import Api from app.apis.hello import api as hello api = Api( title='api', version='1.0', description='', prefix='/api', doc='/api' ) api.add_namespace(hello)
none
1
2.032419
2
tests/test_core.py
Kantouzin/brainfuck
0
4316
<gh_stars>0 # coding: utf-8 import unittest from test.support import captured_stdout from brainfuck import BrainFuck class TestCore(unittest.TestCase): def test_hello_world(self): bf = BrainFuck() with captured_stdout() as stdout: bf.run() self.assertEqual(stdout.getvalue()...
# coding: utf-8 import unittest from test.support import captured_stdout from brainfuck import BrainFuck class TestCore(unittest.TestCase): def test_hello_world(self): bf = BrainFuck() with captured_stdout() as stdout: bf.run() self.assertEqual(stdout.getvalue(), "Hello, wo...
en
0.833554
# coding: utf-8
2.981836
3
main.py
poltavski/social-network-frontend
0
4317
from fastapi import FastAPI, Request, Response from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates from utils import get_page_data, process_initial import uvicorn app = FastAPI() templates = Jinja2Templates(directory="templates") app.mou...
from fastapi import FastAPI, Request, Response from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates from utils import get_page_data, process_initial import uvicorn app = FastAPI() templates = Jinja2Templates(directory="templates") app.mou...
en
0.890256
# Expect requests with cookies # Expect requests with cookies
2.638247
3
Core/Python/create_static_group.py
Ku-Al/OpenManage-Enterprise
0
4318
<gh_stars>0 # # Python script using OME API to create a new static group # # _author_ = <NAME> <<EMAIL>> # _version_ = 0.1 # # Copyright (c) 2020 Dell EMC 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...
# # Python script using OME API to create a new static group # # _author_ = <NAME> <<EMAIL>> # _version_ = 0.1 # # Copyright (c) 2020 Dell EMC 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...
en
0.778908
# # Python script using OME API to create a new static group # # _author_ = <NAME> <<EMAIL>> # _version_ = 0.1 # # Copyright (c) 2020 Dell EMC 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...
2.822309
3
examples/references/segmentation/pascal_voc2012/code/dataflow/dataloaders.py
kagrze/ignite
0
4319
<filename>examples/references/segmentation/pascal_voc2012/code/dataflow/dataloaders.py from typing import Callable, Optional, Tuple, Union import numpy as np from torch.utils.data import DataLoader, Sampler from torch.utils.data.dataset import Subset, ConcatDataset import torch.utils.data.distributed as data_dist fr...
<filename>examples/references/segmentation/pascal_voc2012/code/dataflow/dataloaders.py from typing import Callable, Optional, Tuple, Union import numpy as np from torch.utils.data import DataLoader, Sampler from torch.utils.data.dataset import Subset, ConcatDataset import torch.utils.data.distributed as data_dist fr...
en
0.832012
# random samples for evaluation on training dataset
2.309322
2
saleor/core/jwt.py
autobotasia/saleor
1
4320
<filename>saleor/core/jwt.py from datetime import datetime, timedelta from typing import Any, Dict, Optional import graphene import jwt from django.conf import settings from django.core.handlers.wsgi import WSGIRequest from ..account.models import User from ..app.models import App from .permissions import ( get_p...
<filename>saleor/core/jwt.py from datetime import datetime, timedelta from typing import Any, Dict, Optional import graphene import jwt from django.conf import settings from django.core.handlers.wsgi import WSGIRequest from ..account.models import User from ..app.models import App from .permissions import ( get_p...
en
0.936365
# type: ignore # type: ignore Confirm that token was generated by Saleor not by plugin. Create access token for app. App can use user jwt token to proceed given operation on the Saleor side. The token which can be used by App has additional field defining the permissions assigned to it. The permissions set...
1.988925
2
locust/configuration.py
pancaprima/locust
1
4321
<filename>locust/configuration.py import os, json, logging, jsonpath_rw_ext, jsonpath_rw from jsonpath_rw import jsonpath, parse from . import events from ast import literal_eval from flask import make_response logger = logging.getLogger(__name__) CONFIG_PATH = '/tests/settings/config.json' class ClientConfiguration:...
<filename>locust/configuration.py import os, json, logging, jsonpath_rw_ext, jsonpath_rw from jsonpath_rw import jsonpath, parse from . import events from ast import literal_eval from flask import make_response logger = logging.getLogger(__name__) CONFIG_PATH = '/tests/settings/config.json' class ClientConfiguration:...
en
0.75265
This class is a handler for data configuration with JSON data structure. Will get the data of configuration as JSON. It reads configuration file once. Write JSON file configuration Return an iterator based upon MATCH.PATH. Each item is a path component, start from outer most item. Update JSON dictionar...
2.559751
3
data/migrations/0023_discardaction_answers.py
SIXMON/peps
5
4322
<reponame>SIXMON/peps # Generated by Django 2.2.4 on 2019-11-14 16:48 import django.contrib.postgres.fields.jsonb from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('data', '0022_discardaction'), ] operations = [ migrations.AddField( mo...
# Generated by Django 2.2.4 on 2019-11-14 16:48 import django.contrib.postgres.fields.jsonb from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('data', '0022_discardaction'), ] operations = [ migrations.AddField( model_name='discardactio...
en
0.778181
# Generated by Django 2.2.4 on 2019-11-14 16:48
1.697352
2
app/models.py
juanitodread/pitaya-falcon
0
4323
from json import JSONEncoder from time import time class Jsonable: """Abstract class to standardize the toJson method to be implemented by any class that wants to be serialized to JSON""" def toJson(self): """Abstract method""" raise NotImplementedError('You should implement this method in...
from json import JSONEncoder from time import time class Jsonable: """Abstract class to standardize the toJson method to be implemented by any class that wants to be serialized to JSON""" def toJson(self): """Abstract method""" raise NotImplementedError('You should implement this method in...
en
0.87243
Abstract class to standardize the toJson method to be implemented by any class that wants to be serialized to JSON Abstract method Basic JSON encoder for 'complex (nested)' Python objects.
3.534123
4
compute_pi.py
jakobkogler/pi_memorize
0
4324
<gh_stars>0 """Compute pi.""" from decimal import Decimal, getcontext import argparse import itertools class ComputePi: """Compute pi to a specific precision using multiple algorithms.""" @staticmethod def BBP(precision): """Compute pi using the Bailey-Borwein-Plouffe formula.""" getconte...
"""Compute pi.""" from decimal import Decimal, getcontext import argparse import itertools class ComputePi: """Compute pi to a specific precision using multiple algorithms.""" @staticmethod def BBP(precision): """Compute pi using the Bailey-Borwein-Plouffe formula.""" getcontext().prec = ...
en
0.547574
Compute pi. Compute pi to a specific precision using multiple algorithms. Compute pi using the Bailey-Borwein-Plouffe formula. Calculate arctan(1/x) using euler's accelerated formula. Based on http://www.craig-wood.com/nick/articles/pi-machin/ # round the division Compute pi using Machin's formula. Ba...
3.642743
4
scripts/01_deploy_data_types.py
LaMemeBete/nodys-smart-contract
0
4325
#!/usr/bin/python3 import time from brownie import ( DataTypes, TransparentUpgradeableProxy, ProxyAdmin, config, network, Contract, ) from scripts.helpful_scripts import get_account, encode_function_data def main(): account = get_account() print(config["networks"][network.show_active()...
#!/usr/bin/python3 import time from brownie import ( DataTypes, TransparentUpgradeableProxy, ProxyAdmin, config, network, Contract, ) from scripts.helpful_scripts import get_account, encode_function_data def main(): account = get_account() print(config["networks"][network.show_active()...
en
0.63275
#!/usr/bin/python3 # Optional, deploy the ProxyAdmin and use that as the admin contract # If we want an intializer function we can add # `initializer=box.store, 1` # to simulate the initializer being the `store` function # with a `newValue` of 1 # data_types_encoded_initializer_function = encode_function_data(data_type...
2.210482
2
modules/BidirectionalLSTM.py
omni-us/pytorch-retinanet
12
4326
<filename>modules/BidirectionalLSTM.py import torch.nn as nn class BidirectionalLSTM(nn.Module): # Module to extract BLSTM features from convolutional feature map def __init__(self, nIn, nHidden, nOut): super(BidirectionalLSTM, self).__init__() self.rnn = nn.LSTM(nIn, nHidden, bidirectional=T...
<filename>modules/BidirectionalLSTM.py import torch.nn as nn class BidirectionalLSTM(nn.Module): # Module to extract BLSTM features from convolutional feature map def __init__(self, nIn, nHidden, nOut): super(BidirectionalLSTM, self).__init__() self.rnn = nn.LSTM(nIn, nHidden, bidirectional=T...
en
0.894937
# Module to extract BLSTM features from convolutional feature map # [T * b, nOut]
2.869182
3
release/stubs.min/System/Windows/Forms/__init___parts/PaintEventArgs.py
tranconbv/ironpython-stubs
0
4327
class PaintEventArgs(EventArgs,IDisposable): """ Provides data for the System.Windows.Forms.Control.Paint event. PaintEventArgs(graphics: Graphics,clipRect: Rectangle) """ def Instance(self): """ This function has been arbitrarily put into the stubs""" return PaintEventArgs() def Dispose(self):...
class PaintEventArgs(EventArgs,IDisposable): """ Provides data for the System.Windows.Forms.Control.Paint event. PaintEventArgs(graphics: Graphics,clipRect: Rectangle) """ def Instance(self): """ This function has been arbitrarily put into the stubs""" return PaintEventArgs() def Dispose(self):...
en
0.626863
Provides data for the System.Windows.Forms.Control.Paint event. PaintEventArgs(graphics: Graphics,clipRect: Rectangle) This function has been arbitrarily put into the stubs Dispose(self: PaintEventArgs) Releases all resources used by the System.Windows.Forms.PaintEventArgs. __enter__(self: IDisposable) -> o...
2.108538
2
main.py
JaekwangCha/my_pytorch_templet
0
4328
# written by <NAME> # version 0.1 # ================== IMPORT CUSTOM LEARNING LIBRARIES ===================== # from customs.train import train, test from customs.dataset import load_dataset from customs.model import load_model # ================== TRAINING SETTINGS ================== # import argparse impo...
# written by <NAME> # version 0.1 # ================== IMPORT CUSTOM LEARNING LIBRARIES ===================== # from customs.train import train, test from customs.dataset import load_dataset from customs.model import load_model # ================== TRAINING SETTINGS ================== # import argparse impo...
en
0.463033
# written by <NAME> # version 0.1 # ================== IMPORT CUSTOM LEARNING LIBRARIES ===================== # # ================== TRAINING SETTINGS ================== # # data setting # training parameter setting # optimizer & scheduler setting # ===================== IMPORT PYTORCH LIBRARIES ================== # # ...
2.135858
2
test/core/024-sc4-gridftp-http/Rosetta.py
ahnitz/pegasus
127
4329
<reponame>ahnitz/pegasus #!/usr/bin/env python3 import logging import sys import subprocess from pathlib import Path from datetime import datetime from Pegasus.api import * logging.basicConfig(level=logging.DEBUG) # --- Work Dir Setup ----------------------------------------------------------- RUN_ID = "024-sc4-gri...
#!/usr/bin/env python3 import logging import sys import subprocess from pathlib import Path from datetime import datetime from Pegasus.api import * logging.basicConfig(level=logging.DEBUG) # --- Work Dir Setup ----------------------------------------------------------- RUN_ID = "024-sc4-gridftp-http-" + datetime.no...
en
0.43577
#!/usr/bin/env python3 # --- Work Dir Setup ----------------------------------------------------------- # --- Configuration ------------------------------------------------------------ # --- Sites -------------------------------------------------------------------- pegasus: "5.0" sites: - name: "condor_pool" arch:...
1.981658
2
tests/nls_smoother_test.py
sisl/CEEM
5
4330
<reponame>sisl/CEEM import torch from ceem.opt_criteria import * from ceem.systems import LorenzAttractor from ceem.dynamics import * from ceem.smoother import * from ceem import utils def test_smoother(): utils.set_rng_seed(1) torch.set_default_dtype(torch.float64) sigma = torch.tensor([10.]) rho...
import torch from ceem.opt_criteria import * from ceem.systems import LorenzAttractor from ceem.dynamics import * from ceem.smoother import * from ceem import utils def test_smoother(): utils.set_rng_seed(1) torch.set_default_dtype(torch.float64) sigma = torch.tensor([10.]) rho = torch.tensor([28....
ja
0.109667
# y += torch.rand_like(y) * 0.01 # Test GroupSOSCriterion # Test BlockSparseGroupSOSCriterion
2.087696
2
qiskit/visualization/pulse_v2/device_info.py
godspeed5/qiskit-terra
15
4331
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
en
0.811828
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
2.260671
2
django_gotolong/mfund/views.py
ParikhKadam/gotolong
15
4332
# Create your views here. from .models import Mfund import plotly.graph_objects as go from plotly.offline import plot from plotly.tools import make_subplots from django.db.models import Q from django.conf import settings from django.shortcuts import redirect from django.contrib.auth.decorators import login_require...
# Create your views here. from .models import Mfund import plotly.graph_objects as go from plotly.offline import plot from plotly.tools import make_subplots from django.db.models import Q from django.conf import settings from django.shortcuts import redirect from django.contrib.auth.decorators import login_require...
en
0.627123
# Create your views here. # if pagination is desired # paginate_by = 300 # filter_backends = [filters.OrderingFilter,] # ordering_fields = ['sno', 'nse_symbol'] # fig.show() # fig.show() # declaring template # first delete all existing mfund objects # skip 0 units # breakpoint() # import pdb # pdb.set_trace() # Updated...
2.215464
2
m3u8.py
akria00/m3u8-Downloader-master
2
4333
#coding: utf-8 from gevent import monkey monkey.patch_all() from gevent.pool import Pool import gevent import requests import urllib import os import time import re import ssl class Downloader: def __init__(self, pool_size, retry=3): self.pool = Pool(pool_size) self.session = self._get_http_sessio...
#coding: utf-8 from gevent import monkey monkey.patch_all() from gevent.pool import Pool import gevent import requests import urllib import os import time import re import ssl class Downloader: def __init__(self, pool_size, retry=3): self.pool = Pool(pool_size) self.session = self._get_http_sessio...
en
0.820927
#coding: utf-8
2.459741
2
buzzbox/restaurants/migrations/0002_restaurant_description.py
Danielvalev/kutiika
0
4334
<filename>buzzbox/restaurants/migrations/0002_restaurant_description.py # Generated by Django 3.2.9 on 2021-12-06 10:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('restaurants', '0001_initial'), ] operations = [ migrations.AddField(...
<filename>buzzbox/restaurants/migrations/0002_restaurant_description.py # Generated by Django 3.2.9 on 2021-12-06 10:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('restaurants', '0001_initial'), ] operations = [ migrations.AddField(...
en
0.905228
# Generated by Django 3.2.9 on 2021-12-06 10:02
1.764753
2
src/dsrlib/ui/utils.py
fraca7/dsremap
8
4335
<filename>src/dsrlib/ui/utils.py<gh_stars>1-10 #!/usr/bin/env python3 import os import contextlib from PyQt5 import QtCore, QtWidgets from dsrlib.settings import Settings class LayoutBuilder: def __init__(self, target): self.target = target self._stack = [] @contextlib.contextmanager d...
<filename>src/dsrlib/ui/utils.py<gh_stars>1-10 #!/usr/bin/env python3 import os import contextlib from PyQt5 import QtCore, QtWidgets from dsrlib.settings import Settings class LayoutBuilder: def __init__(self, target): self.target = target self._stack = [] @contextlib.contextmanager d...
en
0.439295
#!/usr/bin/env python3 # pragma: no cover # pragma: no cover # pragma: no cover # pylint: disable=C0111 # pragma: no cover
2.158374
2
src/tiden/tidenrunner.py
mshonichev/example_pkg
0
4336
<reponame>mshonichev/example_pkg<filename>src/tiden/tidenrunner.py #!/usr/bin/env python3 # # Copyright 2017-2020 GridGain Systems. # # 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://...
#!/usr/bin/env python3 # # Copyright 2017-2020 GridGain Systems. # # 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 applicab...
en
0.690168
#!/usr/bin/env python3 # # Copyright 2017-2020 GridGain Systems. # # 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 applicab...
1.709716
2
ludwig/data/cache/manager.py
ludwig-ai/ludw
970
4337
import logging import os import re import uuid from pathlib import Path from ludwig.constants import CHECKSUM, META, TEST, TRAINING, VALIDATION from ludwig.data.cache.util import calculate_checksum from ludwig.utils import data_utils from ludwig.utils.fs_utils import delete, path_exists logger = logging.getLogger(__n...
import logging import os import re import uuid from pathlib import Path from ludwig.constants import CHECKSUM, META, TEST, TRAINING, VALIDATION from ludwig.data.cache.util import calculate_checksum from ludwig.utils import data_utils from ludwig.utils.fs_utils import delete, path_exists logger = logging.getLogger(__n...
en
0.865567
Filters a string to only its alphanumeric characters. # TODO(travis): could try hashing the in-memory dataset, but this is tricky for Dask # Use the input dataset filename (minus the extension) as the cache path # To avoid collisions across different directories, we use the unique checksum # as the cache path
2.388498
2
test_calc_base.py
kshshkim/factorioCalcPy
1
4338
import pprint from FactorioCalcBase.data.binary import sorted_recipe_list, production_machine_category_list_dict from FactorioCalcBase.recipe import Recipe from FactorioCalcBase.calculator_base import CalculatorBase from FactorioCalcBase.dependency_dict_common_function import dict_add_number import time def test_chan...
import pprint from FactorioCalcBase.data.binary import sorted_recipe_list, production_machine_category_list_dict from FactorioCalcBase.recipe import Recipe from FactorioCalcBase.calculator_base import CalculatorBase from FactorioCalcBase.dependency_dict_common_function import dict_add_number import time def test_chan...
none
1
2.328667
2
lib/py/src/Thrift.py
ahfeel/thrift
3
4339
# Copyright (c) 2006- Facebook # Distributed under the Thrift Software License # # See accompanying file LICENSE or visit the Thrift site at: # http://developers.facebook.com/thrift/ class TType: STOP = 0 VOID = 1 BOOL = 2 BYTE = 3 I08 = 3 DOUBLE = 4 I16 = 6 I32 = 8 I64 = 10 STR...
# Copyright (c) 2006- Facebook # Distributed under the Thrift Software License # # See accompanying file LICENSE or visit the Thrift site at: # http://developers.facebook.com/thrift/ class TType: STOP = 0 VOID = 1 BOOL = 2 BYTE = 3 I08 = 3 DOUBLE = 4 I16 = 6 I32 = 8 I64 = 10 STR...
en
0.734203
# Copyright (c) 2006- Facebook # Distributed under the Thrift Software License # # See accompanying file LICENSE or visit the Thrift site at: # http://developers.facebook.com/thrift/ Base class for procsessor, which works on two streams. Base class for all thrift exceptions. Application level thrift exceptions.
1.698225
2
engine.py
nyumaya/wake-word-benchmark
0
4340
<gh_stars>0 # # Copyright 2018 Picovoice 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 2018 Picovoice 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 writ...
en
0.809196
# # Copyright 2018 Picovoice 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 writ...
2.163267
2
objO_and_ctxMgr/harakiri.py
thirschbuechler/didactic-barnacles
0
4341
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 20 22:18:58 2020 @author: https://stackoverflow.com/questions/293431/python-object-deleting-itself @editor: thirschbuechler this is probably overkill to alternatively exit a with-context, rather than by exception, but hey, maybe it will be needed, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 20 22:18:58 2020 @author: https://stackoverflow.com/questions/293431/python-object-deleting-itself @editor: thirschbuechler this is probably overkill to alternatively exit a with-context, rather than by exception, but hey, maybe it will be needed, ...
en
0.911557
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon Jan 20 22:18:58 2020 @author: https://stackoverflow.com/questions/293431/python-object-deleting-itself @editor: thirschbuechler this is probably overkill to alternatively exit a with-context, rather than by exception, but hey, maybe it will be needed, or r...
2.681887
3
chapter2/gestures.py
srimani-programmer/Opencv-with-Python-Blueprints-second-Edition
39
4342
#!/usr/bin/env python # -*- coding: utf-8 -*- """A module containing an algorithm for hand gesture recognition""" import numpy as np import cv2 from typing import Tuple __author__ = "<NAME>" __license__ = "GNU GPL 3.0 or later" def recognize(img_gray): """Recognizes hand gesture in a single-channel depth image ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """A module containing an algorithm for hand gesture recognition""" import numpy as np import cv2 from typing import Tuple __author__ = "<NAME>" __license__ = "GNU GPL 3.0 or later" def recognize(img_gray): """Recognizes hand gesture in a single-channel depth image ...
en
0.86812
#!/usr/bin/env python # -*- coding: utf-8 -*- A module containing an algorithm for hand gesture recognition Recognizes hand gesture in a single-channel depth image This method estimates the number of extended fingers based on a single-channel depth image showing a hand and arm region. :param im...
3.728744
4
satt/trace/logger/panic.py
jnippula/satt
54
4343
<filename>satt/trace/logger/panic.py #!/usr/bin/env python # -*- coding: utf-8 -*- ''' // Copyright (c) 2015 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 // // h...
<filename>satt/trace/logger/panic.py #!/usr/bin/env python # -*- coding: utf-8 -*- ''' // Copyright (c) 2015 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 // // h...
en
0.651134
#!/usr/bin/env python # -*- coding: utf-8 -*- // Copyright (c) 2015 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...
2.660994
3
xlab/cli.py
csalcedo001/xlab
1
4344
import sys import os from . import filesys MAIN_USAGE_MESSAGE = """ usage: xlab command ... Options: positional arguments: command project """ def project(args): if len(args) != 1: print("error: Invalid arguments.") exit() if args[0] == 'init': root = os.getcwd() ...
import sys import os from . import filesys MAIN_USAGE_MESSAGE = """ usage: xlab command ... Options: positional arguments: command project """ def project(args): if len(args) != 1: print("error: Invalid arguments.") exit() if args[0] == 'init': root = os.getcwd() ...
en
0.595384
usage: xlab command ... Options: positional arguments: command project
2.625006
3
python/paddle/optimizer/adamw.py
jzhang533/Paddle
0
4345
# Copyright (c) 2021 PaddlePaddle 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 appli...
# Copyright (c) 2021 PaddlePaddle 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 appli...
en
0.656182
# Copyright (c) 2021 PaddlePaddle 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 appli...
2.079408
2
tests/resources/test_interactions.py
VinLau/BAR_API
1
4346
<reponame>VinLau/BAR_API<gh_stars>1-10 from api import app from unittest import TestCase class TestIntegrations(TestCase): maxDiff = None def setUp(self): self.app_client = app.test_client() def test_get_itrns(self): """ This function test retrieving protein interactions for var...
from api import app from unittest import TestCase class TestIntegrations(TestCase): maxDiff = None def setUp(self): self.app_client = app.test_client() def test_get_itrns(self): """ This function test retrieving protein interactions for various species' genes. """ ...
en
0.657269
This function test retrieving protein interactions for various species' genes. # Valid request rice # Invalid species # Invalid gene id # Gene does not exist
3.052567
3
src/dialogflow-java-client-master/samples/clients/VirtualTradingAssistant/src/main/java/ai/examples/scraper/historicalScrape.py
16kozlowskim/Group-20-SE
0
4347
# install BeautifulSoup4 before running # # prints out historical data in csv format: # # [date, open, high, low, close, volume] # import re, csv, sys, urllib2 from bs4 import BeautifulSoup # If start date and end date is the same only one value will be returned and # if not the multiple values which can be used to ma...
# install BeautifulSoup4 before running # # prints out historical data in csv format: # # [date, open, high, low, close, volume] # import re, csv, sys, urllib2 from bs4 import BeautifulSoup # If start date and end date is the same only one value will be returned and # if not the multiple values which can be used to ma...
en
0.585328
# install BeautifulSoup4 before running # # prints out historical data in csv format: # # [date, open, high, low, close, volume] # # If start date and end date is the same only one value will be returned and # if not the multiple values which can be used to make calculations # # ticker (company symbol) # interval (d (d...
3.133777
3
client/client.py
odontomachus/hotbox
0
4348
<reponame>odontomachus/hotbox<filename>client/client.py<gh_stars>0 import sys import io from collections import defaultdict import struct from time import sleep import queue import threading import serial from serial import SerialException RUN_LABELS = ('Time left', 'Temp 1', 'Temp 2', 'Off Goal', 'Temp Change', 'Dut...
import sys import io from collections import defaultdict import struct from time import sleep import queue import threading import serial from serial import SerialException RUN_LABELS = ('Time left', 'Temp 1', 'Temp 2', 'Off Goal', 'Temp Change', 'Duty cycle (/30)', 'Heating', 'Cycle', 'Total time', 'Goal temp') MSG...
en
0.586937
# can't connect to serial # workaround for bug in pyserial # http://sourceforge.net/p/pyserial/patches/37/ Client class for hotbox serial connection # empty buffer # workaround for bug in pyserial # http://sourceforge.net/p/pyserial/patches/37/ # Don't do anything if disconnected # workaround for bug in pyserial # http...
2.630972
3
test/functional/abc-sync-chain.py
ComputerCraftr/devault
35
4349
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test that a node receiving many (potentially out of order) blocks exits initial block download (IBD; this occur...
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test that a node receiving many (potentially out of order) blocks exits initial block download (IBD; this occur...
en
0.86427
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. Test that a node receiving many (potentially out of order) blocks exits initial block download (IBD; this occurs onc...
2.346469
2
djangostagram/posts/models.py
hongsemy/InstagramWithDjango
0
4350
<reponame>hongsemy/InstagramWithDjango from django.db import models from djangostagram.users import models as user_model # Create your models here. # This class is used in other models as an inheritance. # An often-used pattern class TimeStamedModel(models.Model): created_at = models.DateTimeField(auto_now_add=T...
from django.db import models from djangostagram.users import models as user_model # Create your models here. # This class is used in other models as an inheritance. # An often-used pattern class TimeStamedModel(models.Model): created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeFi...
en
0.943657
# Create your models here. # This class is used in other models as an inheritance. # An often-used pattern # An option that makes this model to not show up directly on the database
2.701176
3
guillotina/contrib/workflows/events.py
rboixaderg/guillotina
173
4351
from guillotina.contrib.workflows.interfaces import IWorkflowChangedEvent from guillotina.events import ObjectEvent from zope.interface import implementer @implementer(IWorkflowChangedEvent) class WorkflowChangedEvent(ObjectEvent): """An object has been moved""" def __init__(self, object, workflow, action, c...
from guillotina.contrib.workflows.interfaces import IWorkflowChangedEvent from guillotina.events import ObjectEvent from zope.interface import implementer @implementer(IWorkflowChangedEvent) class WorkflowChangedEvent(ObjectEvent): """An object has been moved""" def __init__(self, object, workflow, action, c...
en
0.998576
An object has been moved
1.916761
2
data_steward/cdr_cleaner/cleaning_rules/covid_ehr_vaccine_concept_suppression.py
lrwb-aou/curation
16
4352
""" Suppress COVID EHR vaccine concepts. Original Issues: DC-1692 """ # Python imports import logging # Project imports from cdr_cleaner.cleaning_rules.deid.concept_suppression import AbstractBqLookupTableConceptSuppression from constants.cdr_cleaner import clean_cdr as cdr_consts from common import JINJA_ENV, CDM_T...
""" Suppress COVID EHR vaccine concepts. Original Issues: DC-1692 """ # Python imports import logging # Project imports from cdr_cleaner.cleaning_rules.deid.concept_suppression import AbstractBqLookupTableConceptSuppression from constants.cdr_cleaner import clean_cdr as cdr_consts from common import JINJA_ENV, CDM_T...
en
0.727383
Suppress COVID EHR vaccine concepts. Original Issues: DC-1692 # Python imports # Project imports # Third party imports CREATE OR REPLACE TABLE `{{project_id}}.{{sandbox_id}}.{{concept_suppression_lookup_table}}` AS with covid_vacc as ( SELECT * FROM `{{project_id}}.{{dataset_id}}.concept` WHERE ( ...
1.877767
2
pydbhub/httphub.py
sum3105/pydbhub
18
4353
import pydbhub from typing import Any, Dict, List, Tuple from json.decoder import JSONDecodeError import requests import io def send_request_json(query_url: str, data: Dict[str, Any]) -> Tuple[List[Any], str]: """ send_request_json sends a request to DBHub.io, formatting the returned result as JSON Param...
import pydbhub from typing import Any, Dict, List, Tuple from json.decoder import JSONDecodeError import requests import io def send_request_json(query_url: str, data: Dict[str, Any]) -> Tuple[List[Any], str]: """ send_request_json sends a request to DBHub.io, formatting the returned result as JSON Param...
en
0.641693
send_request_json sends a request to DBHub.io, formatting the returned result as JSON Parameters ---------- query_url : str url of the API endpoint data : Dict[str, Any] data to be processed to the server. Returns ------- Tuple[List[Any], str] The returned data is ...
3.307831
3
test_calcscore.py
BrandonLeiran/bracket-scoring
0
4354
<reponame>BrandonLeiran/bracket-scoring import pytest from calcscore import round_score # you'll be picking what teams make it to the next round # - so picking 32, then 16, then 8, 4, 2, 1...i.e. round 1-6 winners # teams will have a name & a seed # seed doesn't change, so maybe make that not passed around w/ result...
import pytest from calcscore import round_score # you'll be picking what teams make it to the next round # - so picking 32, then 16, then 8, 4, 2, 1...i.e. round 1-6 winners # teams will have a name & a seed # seed doesn't change, so maybe make that not passed around w/ results def test_round_score_invalid_round():...
en
0.950084
# you'll be picking what teams make it to the next round # - so picking 32, then 16, then 8, 4, 2, 1...i.e. round 1-6 winners # teams will have a name & a seed # seed doesn't change, so maybe make that not passed around w/ results # score = round_score(0) # assert score == 0
2.8026
3
tests/test_get.py
bgyori/pyobo
0
4355
<filename>tests/test_get.py import unittest from operator import attrgetter import obonet from pyobo import SynonymTypeDef, get from pyobo.struct import Reference from pyobo.struct.struct import ( iterate_graph_synonym_typedefs, iterate_graph_typedefs, iterate_node_parents, iterate_node_properties, iterate_no...
<filename>tests/test_get.py import unittest from operator import attrgetter import obonet from pyobo import SynonymTypeDef, get from pyobo.struct import Reference from pyobo.struct.struct import ( iterate_graph_synonym_typedefs, iterate_graph_typedefs, iterate_node_parents, iterate_node_properties, iterate_no...
en
0.781384
Test getting type definitions from an :mod:`obonet` graph. Test getting synonym type definitions from an :mod:`obonet` graph. Test getting synonyms from a node in a :mod:`obonet` graph. # TODO implement # self.assertEqual(SynonymTypeDef(id='IUPAC_NAME', name='IUPAC NAME'), synonym.type) Test getting properties from a n...
2.342985
2
src/commons.py
ymontilla/WebScrapingCatastro
0
4356
<reponame>ymontilla/WebScrapingCatastro # -*- coding: utf-8 -*- # + ## Utilidades comunes entre places y OSM. # + import csv import ast import codecs from math import cos, asin, sqrt # + def read_csv_with_encoding(filename, delimiter="|", encoding="iso-8859-1"): with codecs.open(filename, encoding=encoding) as ...
# -*- coding: utf-8 -*- # + ## Utilidades comunes entre places y OSM. # + import csv import ast import codecs from math import cos, asin, sqrt # + def read_csv_with_encoding(filename, delimiter="|", encoding="iso-8859-1"): with codecs.open(filename, encoding=encoding) as fp: reader = csv.reader(fp, deli...
es
0.973024
# -*- coding: utf-8 -*- # + ## Utilidades comunes entre places y OSM. # + # + # - El resultado de la medición de distancia esta en kilometros. #Pi/180 El proceso es muy pesado y no es posible hacer el ananlisis con toda la data de bogotá, el número de registros es demasiado grande para caber en memoria. El uso correcto...
3.54065
4
GamesGetter.py
JamescMcE/BasketBet
0
4357
#This script Imports Game Data from ESPN, and Odds from the ODDS-API, and then imports them into a MySQL table, example in workbench here https://puu.sh/HOKCj/ce199eec8e.png import mysql.connector import requests import json import datetime import time #Connection to the MYSQL Server. mydb = mysql.connector....
#This script Imports Game Data from ESPN, and Odds from the ODDS-API, and then imports them into a MySQL table, example in workbench here https://puu.sh/HOKCj/ce199eec8e.png import mysql.connector import requests import json import datetime import time #Connection to the MYSQL Server. mydb = mysql.connector....
en
0.884254
#This script Imports Game Data from ESPN, and Odds from the ODDS-API, and then imports them into a MySQL table, example in workbench here https://puu.sh/HOKCj/ce199eec8e.png #Connection to the MYSQL Server. #Games List. #Gets the game Data from ESPN API given the link. #Json Response for YESTERDAY. #Loop through to col...
3.049163
3
neurodocker/tests/test_neurodocker.py
effigies/neurodocker
1
4358
<filename>neurodocker/tests/test_neurodocker.py """Tests for neurodocker.main""" # Author: <NAME> <<EMAIL>> from __future__ import absolute_import, unicode_literals import sys import pytest from neurodocker.neurodocker import create_parser, parse_args, main def test_generate(): args = ("generate -b ubuntu:17....
<filename>neurodocker/tests/test_neurodocker.py """Tests for neurodocker.main""" # Author: <NAME> <<EMAIL>> from __future__ import absolute_import, unicode_literals import sys import pytest from neurodocker.neurodocker import create_parser, parse_args, main def test_generate(): args = ("generate -b ubuntu:17....
en
0.85344
Tests for neurodocker.main # Author: <NAME> <<EMAIL>> # These indices chop off the header (with timestamp) and the layer that # saves to JSON (with timestamp).
2.295624
2
fuzzers/011-cle-ffconfig/generate.py
tmichalak/prjuray
39
4359
<filename>fuzzers/011-cle-ffconfig/generate.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The Project U-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier:...
<filename>fuzzers/011-cle-ffconfig/generate.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The Project U-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier:...
en
0.721729
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The Project U-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC FDCE Primitive: D Flip-Flop with Clock Ena...
1.993828
2
hmc/integrators/states/riemannian_leapfrog_state.py
JamesBrofos/Thresholds-in-Hamiltonian-Monte-Carlo
1
4360
from typing import Callable import numpy as np from hmc.integrators.states.leapfrog_state import LeapfrogState from hmc.integrators.fields import riemannian from hmc.linalg import solve_psd class RiemannianLeapfrogState(LeapfrogState): """The Riemannian leapfrog state uses the Fisher information matrix to provi...
from typing import Callable import numpy as np from hmc.integrators.states.leapfrog_state import LeapfrogState from hmc.integrators.fields import riemannian from hmc.linalg import solve_psd class RiemannianLeapfrogState(LeapfrogState): """The Riemannian leapfrog state uses the Fisher information matrix to provi...
en
0.825811
The Riemannian leapfrog state uses the Fisher information matrix to provide a position-dependent Riemannian metric. As such, computing the gradients of the Hamiltonian requires higher derivatives of the metric, which vanish in the Euclidean case.
2.567977
3
MultirangerTest.py
StuartLiam/DroneNavigationOnboard
0
4361
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Cop...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2...
en
0.837684
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2...
2.082342
2
employees/choices.py
sauli6692/barbershop
0
4362
from django.utils.translation import ugettext_lazy as _ USER_TYPE_STAFF = 'STAFF' USER_TYPE_ADMIN = 'ADMIN' USER_TYPE_BARBER = 'BARBER' USER_TYPE_CHOICES = ( (USER_TYPE_STAFF, _('Dev')), (USER_TYPE_ADMIN, _('Admin')), (USER_TYPE_BARBER, _('Barber')), )
from django.utils.translation import ugettext_lazy as _ USER_TYPE_STAFF = 'STAFF' USER_TYPE_ADMIN = 'ADMIN' USER_TYPE_BARBER = 'BARBER' USER_TYPE_CHOICES = ( (USER_TYPE_STAFF, _('Dev')), (USER_TYPE_ADMIN, _('Admin')), (USER_TYPE_BARBER, _('Barber')), )
none
1
1.731439
2
tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/html5test.py
google-ar/chromium
2,151
4363
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState from telemetry.page import page as page_module from telemetry import story cla...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState from telemetry.page import page as page_module from telemetry import story cla...
en
0.910206
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Chrome proxy test page for traffic over https.
2.523616
3
lessons/sqlite_example/database.py
eliranM98/python_course
6
4364
<reponame>eliranM98/python_course """ in this example we want to create a user credentials database with: user_id & password logger showing connection logs, DB version, errors during fetching & executing """ import sqlite3 from lessons.sqlite_example.log import create as create_logger class Commands: create_user...
""" in this example we want to create a user credentials database with: user_id & password logger showing connection logs, DB version, errors during fetching & executing """ import sqlite3 from lessons.sqlite_example.log import create as create_logger class Commands: create_users_table = ''' CREATE TABLE...
en
0.387334
in this example we want to create a user credentials database with: user_id & password logger showing connection logs, DB version, errors during fetching & executing CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id text, password text ); get_la...
4.020048
4
backend/app/projectx/routing.py
emmawoollett/projectx
0
4365
<gh_stars>0 from django.urls import re_path from projectx.consumers import UserWebSocketConsumer from .consumers import UserWebSocketConsumer websocket_urlpatterns = [ re_path(r"^ws/$", UserWebSocketConsumer.as_asgi()), ]
from django.urls import re_path from projectx.consumers import UserWebSocketConsumer from .consumers import UserWebSocketConsumer websocket_urlpatterns = [ re_path(r"^ws/$", UserWebSocketConsumer.as_asgi()), ]
none
1
1.65662
2
aldryn_search/cms_apps.py
lab360-ch/aldryn-search
11
4366
<reponame>lab360-ch/aldryn-search<filename>aldryn_search/cms_apps.py<gh_stars>10-100 from django.utils.translation import ugettext_lazy as _ from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from .conf import settings class AldrynSearchApphook(CMSApp): name = _("aldryn search") def ...
from django.utils.translation import ugettext_lazy as _ from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from .conf import settings class AldrynSearchApphook(CMSApp): name = _("aldryn search") def get_urls(self, *args, **kwargs): return ['aldryn_search.urls'] if settings....
none
1
1.893381
2
BizPy/openpyxl/20200513/horizontal_chart.py
t2y/python-study
18
4367
<filename>BizPy/openpyxl/20200513/horizontal_chart.py import pandas as pd from openpyxl import Workbook from openpyxl.chart import BarChart, Reference wb = Workbook() ws = wb.active df = pd.read_csv('population.csv') ws.append(df.columns.tolist()) for row in df.values: ws.append(list(row)) row_length...
<filename>BizPy/openpyxl/20200513/horizontal_chart.py import pandas as pd from openpyxl import Workbook from openpyxl.chart import BarChart, Reference wb = Workbook() ws = wb.active df = pd.read_csv('population.csv') ws.append(df.columns.tolist()) for row in df.values: ws.append(list(row)) row_length...
none
1
2.9548
3
changes/api/serializer/models/logsource.py
alex/changes
1
4368
<filename>changes/api/serializer/models/logsource.py<gh_stars>1-10 from changes.api.serializer import Serializer, register from changes.models.log import LogSource @register(LogSource) class LogSourceSerializer(Serializer): def serialize(self, instance, attrs): return { 'id': instance.id.hex, ...
<filename>changes/api/serializer/models/logsource.py<gh_stars>1-10 from changes.api.serializer import Serializer, register from changes.models.log import LogSource @register(LogSource) class LogSourceSerializer(Serializer): def serialize(self, instance, attrs): return { 'id': instance.id.hex, ...
none
1
1.804339
2
examples/prostate/data_preparation/utils/nrrd_to_nifti.py
IsaacYangSLA/NVFlare
0
4369
<filename>examples/prostate/data_preparation/utils/nrrd_to_nifti.py # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 # # ...
<filename>examples/prostate/data_preparation/utils/nrrd_to_nifti.py # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 # # ...
en
0.853974
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ...
2.195566
2
setup.py
jszakmeister/rst2ctags
23
4370
<reponame>jszakmeister/rst2ctags from setuptools import setup import io import os import re version_re = re.compile(r'^__version__ = "([^"]*)"$') # Find the version number. with open('rst2ctags.py', 'r') as f: for line in f: line = line.rstrip() m = version_re.match(line) if m: ...
from setuptools import setup import io import os import re version_re = re.compile(r'^__version__ = "([^"]*)"$') # Find the version number. with open('rst2ctags.py', 'r') as f: for line in f: line = line.rstrip() m = version_re.match(line) if m: version = m.group(1) ...
en
0.633268
# Find the version number. # Load the description.
2.115388
2
py-ws/hardshare/cli.py
rerobots/hardshare
8
4371
#!/usr/bin/env python # Copyright (C) 2018 rerobots, 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
#!/usr/bin/env python # Copyright (C) 2018 rerobots, 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
en
0.791096
#!/usr/bin/env python # Copyright (C) 2018 rerobots, 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
1.883061
2
Dataset/Leetcode/train/7/93.py
kkcookies99/UAST
0
4372
<reponame>kkcookies99/UAST class Solution: def XXX(self, x: int) -> int: def solve(x): a = list(map(int,str(x))) p = {} d=0 for ind, val in enumerate(a): p[ind] = val for i, v in p.items(): d += v*(10**i) ...
class Solution: def XXX(self, x: int) -> int: def solve(x): a = list(map(int,str(x))) p = {} d=0 for ind, val in enumerate(a): p[ind] = val for i, v in p.items(): d += v*(10**i) if (2**31 - 1>= d >= -(2**...
none
1
2.944317
3
app/realty.py
JenBanks8585/Labs_CitySpireDS
0
4373
"""Realty Info""" import os import requests from dotenv import load_dotenv from fastapi import APIRouter, Depends import sqlalchemy from pydantic import BaseModel, SecretStr from app import config from app.walk_score import * load_dotenv() router = APIRouter() headers = {'x-rapidapi-key': os.getenv('api_key'), ...
"""Realty Info""" import os import requests from dotenv import load_dotenv from fastapi import APIRouter, Depends import sqlalchemy from pydantic import BaseModel, SecretStr from app import config from app.walk_score import * load_dotenv() router = APIRouter() headers = {'x-rapidapi-key': os.getenv('api_key'), ...
en
0.5328
Realty Info Parameters: api_key city: str state: str prop_type: str ('condo', 'single_family', 'multi_family') limit: int number of results to populate Returns: information about properties for rent Parameters: api_key city: str state: str ...
2.527261
3
dist/weewx-4.0.0b3/bin/weewx/junk2.py
v0rts/docker-weewx
10
4374
from __future__ import print_function import time import weeutil.weeutil import weewx.manager import weewx.xtypes archive_sqlite = {'database_name': '/home/weewx/archive/weepwr.sdb', 'driver': 'weedb.sqlite'} archive_mysql = {'database_name': 'weewx', 'user': 'weewx', 'password': '<PASSWORD>', 'driver': 'weedb.mysql'...
from __future__ import print_function import time import weeutil.weeutil import weewx.manager import weewx.xtypes archive_sqlite = {'database_name': '/home/weewx/archive/weepwr.sdb', 'driver': 'weedb.sqlite'} archive_mysql = {'database_name': 'weewx', 'user': 'weewx', 'password': '<PASSWORD>', 'driver': 'weedb.mysql'...
en
0.62322
Select a.dateTime as StartTime , b.dateTime as EndTime , b.dateTime-a.dateTime as TimeChange , b.ch8_a_energy2-a.ch8_a_energy2 as ValueChange FROM archive a Inner Join archive b ON b.dateTime>=1573245000 AND b.dateTime<=(1573245000 + 600) Select a.dateTime as StartTime, b.datetime as EndTime, b....
2.325803
2
fast_lemon_api_test.py
a6502/fast_lemon_api
0
4375
<gh_stars>0 #!/usr/bin/env pytest-3 from fastapi.testclient import TestClient from fast_lemon_api import app client = TestClient(app) def test_get_root(): response = client.get("/") assert response.status_code == 200 assert response.text == "Welcome to the fast-lemon-api!\n" neworder = { "isin": ...
#!/usr/bin/env pytest-3 from fastapi.testclient import TestClient from fast_lemon_api import app client = TestClient(app) def test_get_root(): response = client.get("/") assert response.status_code == 200 assert response.text == "Welcome to the fast-lemon-api!\n" neworder = { "isin": "blablablabl...
ru
0.24668
#!/usr/bin/env pytest-3 #print(repr(j)) #assert 0
2.616711
3
tests/regenerate_credentials.py
andrewkozlik/pam-u2f
0
4376
#!/bin/python2 import collections import re import subprocess import sys PUC = "../pamu2fcfg/pamu2fcfg" resident = ["", "-r"] presence = ["", "-P"] pin = ["", "-N"] verification = ["", "-V"] Credential = collections.namedtuple("Credential", "keyhandle pubkey attributes oldformat") sshformat = 0 def print_test_...
#!/bin/python2 import collections import re import subprocess import sys PUC = "../pamu2fcfg/pamu2fcfg" resident = ["", "-r"] presence = ["", "-P"] pin = ["", "-N"] verification = ["", "-V"] Credential = collections.namedtuple("Credential", "keyhandle pubkey attributes oldformat") sshformat = 0 def print_test_...
en
0.320238
#!/bin/python2 cfg.auth_file = "{authfile}"; cfg.sshformat = {ssh}; rc = get_devices_from_authfile(&cfg, username, dev, &n_devs); assert(rc == 1); assert(n_devs == {devices}); assert(strcmp(dev[{i}].coseType, "es256") == 0); assert(strcmp(dev[{i}].keyHandle, "{kh}") == 0); assert(strcmp(dev[{i}].publicKey, ...
2.21307
2
tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_scalar_test.py
zhangyujing/tensorflow
13
4377
# Copyright 2016 The TensorFlow 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 applica...
# Copyright 2016 The TensorFlow 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 applica...
en
0.829644
# Copyright 2016 The TensorFlow 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 applica...
2.136091
2
mule/util/algorand_util.py
bricerisingalgorand/mule
0
4378
<reponame>bricerisingalgorand/mule import os import subprocess import json import urllib.request from mule.util import os_util from mule.util import file_util from mule.util import time_util from mule.util import s3_util from mule.util import semver_util import platform def build_algo_release_url(package_type, channel...
import os import subprocess import json import urllib.request from mule.util import os_util from mule.util import file_util from mule.util import time_util from mule.util import s3_util from mule.util import semver_util import platform def build_algo_release_url(package_type, channel, os_type, cpu_arch_type, package_v...
en
0.760004
Download and install algod.
2.076722
2
examples/showcase/src/demos_panels/scrollPanel.py
allbuttonspressed/pyjs
0
4379
""" The ``ui.ScrollPanel`` class implements a panel that scrolls its contents. If you want the scroll bars to be always visible, call ``setAlwaysShowScrollBars(True)``. You can also change the current scrolling position programmatically by calling ``setScrollPosition(vPos)`` and ``setScrollHorizontalPosition(hPos)`` ...
""" The ``ui.ScrollPanel`` class implements a panel that scrolls its contents. If you want the scroll bars to be always visible, call ``setAlwaysShowScrollBars(True)``. You can also change the current scrolling position programmatically by calling ``setScrollPosition(vPos)`` and ``setScrollHorizontalPosition(hPos)`` ...
en
0.833831
The ``ui.ScrollPanel`` class implements a panel that scrolls its contents. If you want the scroll bars to be always visible, call ``setAlwaysShowScrollBars(True)``. You can also change the current scrolling position programmatically by calling ``setScrollPosition(vPos)`` and ``setScrollHorizontalPosition(hPos)`` to c...
3.71729
4
psdn.py
xiongchiamiov/phone-suitable-domain-name
3
4380
<filename>psdn.py #!/usr/bin/env python3 # May you recognize your weaknesses and share your strengths. # May you share freely, never taking more than you give. # May you find love and love everyone you find. import re import time import whois phone_spellable = re.compile(r'^[filoqrsuwxy]+$') candidate_words = [] w...
<filename>psdn.py #!/usr/bin/env python3 # May you recognize your weaknesses and share your strengths. # May you share freely, never taking more than you give. # May you find love and love everyone you find. import re import time import whois phone_spellable = re.compile(r'^[filoqrsuwxy]+$') candidate_words = [] w...
en
0.941977
#!/usr/bin/env python3 # May you recognize your weaknesses and share your strengths. # May you share freely, never taking more than you give. # May you find love and love everyone you find.
2.803593
3
src/requester/py/ElevatorTestCaseList.py
akzare/Elevator_Sys_Design
1
4381
''' * @file ElevatorTestCaseList.py * @author <NAME> * @date 30 July 2020 * @version 0.1 * @brief Implements a class to hold all the test cases during the program life cycle. ''' #!/usr/bin/env python3 import sys import ctypes import ElevatorConfig as cfg import ElevatorMsgProtocol as msgProto class Elev...
''' * @file ElevatorTestCaseList.py * @author <NAME> * @date 30 July 2020 * @version 0.1 * @brief Implements a class to hold all the test cases during the program life cycle. ''' #!/usr/bin/env python3 import sys import ctypes import ElevatorConfig as cfg import ElevatorMsgProtocol as msgProto class Elev...
en
0.426469
* @file ElevatorTestCaseList.py * @author <NAME> * @date 30 July 2020 * @version 0.1 * @brief Implements a class to hold all the test cases during the program life cycle. #!/usr/bin/env python3 This class builds a test case list out of the configuration and holds it during the runtime Creates a test case li...
2.683863
3
cart/views.py
pmaigutyak/mp-cart
1
4382
<gh_stars>1-10 from django.utils.translation import ugettext from django.views.decorators.http import require_POST from django.http import JsonResponse from django.shortcuts import render from django.core.exceptions import ValidationError from django.views.decorators.csrf import csrf_exempt from cart.lib import get_c...
from django.utils.translation import ugettext from django.views.decorators.http import require_POST from django.http import JsonResponse from django.shortcuts import render from django.core.exceptions import ValidationError from django.views.decorators.csrf import csrf_exempt from cart.lib import get_cart from cart.fo...
none
1
1.947184
2
ChessAI/src/const.py
darius-luca-tech/AI_Projects
2
4383
#------ game constants -----# #players WHITE = 0 BLACK = 1 BOTH = 2 #color for onTurnLabel PLAYER_COLOR = ["white", "black"] #figures PAWN = 1 KNIGHT = 2 BISHOP = 3 ROOK = 4 QUEEN = 5 KING = 6 FIGURE_NAME = [ "", "pawn", "knight", "bishop", "rook", "queen", "king" ] #used in move 32bit for prom...
#------ game constants -----# #players WHITE = 0 BLACK = 1 BOTH = 2 #color for onTurnLabel PLAYER_COLOR = ["white", "black"] #figures PAWN = 1 KNIGHT = 2 BISHOP = 3 ROOK = 4 QUEEN = 5 KING = 6 FIGURE_NAME = [ "", "pawn", "knight", "bishop", "rook", "queen", "king" ] #used in move 32bit for prom...
en
0.552596
#------ game constants -----# #players #color for onTurnLabel #figures #used in move 32bit for promotion figure prom_figure = figure-2 #all lines #all squares #----- game display constants -----# #----- move types -----# #----- move 32bit reservation -----# # a single move is stored in 32 bit as follows # xxxxxxxx xx x...
2.104488
2
agent.py
kapzlok2408/Pokemon-Showdown-Node-Bot
0
4384
<reponame>kapzlok2408/Pokemon-Showdown-Node-Bot<gh_stars>0 import gym import gym_pokemon import random if __name__ == "__main__": env = gym.make("Pokemon-v0") total_reward = 0.0 total_steps = 0 obs = env.reset() while True: action = random.randint(-1,8) obs, reward, done, _ = env.step(action) total_reward ...
import gym import gym_pokemon import random if __name__ == "__main__": env = gym.make("Pokemon-v0") total_reward = 0.0 total_steps = 0 obs = env.reset() while True: action = random.randint(-1,8) obs, reward, done, _ = env.step(action) total_reward += reward total_steps += 1 print("Currently %d steps, t...
none
1
3.018852
3
Curso-Em-Video-Python/Mundo-2/EXs/EX038.py
victor-da-costa/Aprendendo-Python
0
4385
<reponame>victor-da-costa/Aprendendo-Python<filename>Curso-Em-Video-Python/Mundo-2/EXs/EX038.py num1 = int(input('Digite o 1º número: ')) num2 = int(input('Digite o 2º número: ')) if num1 > num2: print('O {} é maior que {}'.format(num1, num2)) elif num1 < num2: print('O {} é maior que4 {}'.format(num2, num1)) e...
num1 = int(input('Digite o 1º número: ')) num2 = int(input('Digite o 2º número: ')) if num1 > num2: print('O {} é maior que {}'.format(num1, num2)) elif num1 < num2: print('O {} é maior que4 {}'.format(num2, num1)) else: print('Os números são iguais')
none
1
4.009392
4
setup.py
danjjl/ipyfilechooser
0
4386
#!/usr/bin/env python import os from setuptools import setup, find_packages def read(fname): """Open files relative to package.""" return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='ipyfilechooser', version='0.3.1', author='<NAME> (@crahan)', author_email='<EMAIL...
#!/usr/bin/env python import os from setuptools import setup, find_packages def read(fname): """Open files relative to package.""" return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='ipyfilechooser', version='0.3.1', author='<NAME> (@crahan)', author_email='<EMAIL...
en
0.357866
#!/usr/bin/env python Open files relative to package.
1.671847
2
appengine/chromium_build_logs/handler.py
mithro/chromium-infra
1
4387
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import appengine_config import datetime import json import logging import os.path import pickle import sys import urllib sys.path.append( os.path.j...
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import appengine_config import datetime import json import logging import os.path import pickle import sys import urllib sys.path.append( os.path.j...
en
0.879718
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=pointless-string-statement When displaying a list of results, how many to display on one page. Convert a value to an int, or the default...
2.013372
2
aws_lambda/pytorch/source/caffe2/python/operator_test/elementwise_op_broadcast_test.py
YevhenVieskov/ML-DL-in-production
4
4388
<reponame>YevhenVieskov/ML-DL-in-production from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest from hypothesis import given import numpy as np from caffe2.proto import caffe2_pb2 from caffe2.python impor...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest from hypothesis import given import numpy as np from caffe2.proto import caffe2_pb2 from caffe2.python import core, workspace import caffe2.python.hypot...
en
0.877526
# TODO(jiayq): make them hypothesis tests for better coverage. # Set broadcast and no axis, i.e. broadcasting last dimensions. # broadcasting intermediate dimensions # broadcasting the first dimension # broadcasting with single elem dimensions at both ends # Set broadcast and no axis, i.e. broadcasting last dimensions....
2.265023
2
kayobe/tests/unit/cli/test_commands.py
jovial/kayobe
0
4389
<filename>kayobe/tests/unit/cli/test_commands.py # Copyright (c) 2017 StackHPC Ltd. # # 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 # # Unl...
<filename>kayobe/tests/unit/cli/test_commands.py # Copyright (c) 2017 StackHPC Ltd. # # 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 # # Unl...
en
0.852754
# Copyright (c) 2017 StackHPC Ltd. # # 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 wr...
2.123817
2
keras2onnx/proto/tfcompat.py
CNugteren/keras-onnx
1
4390
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### imp...
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### imp...
de
0.370313
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### # t...
2.203096
2
back2back/httpmulticlient.py
excentis/ByteBlower_python_examples
2
4391
<gh_stars>1-10 """ HTTP MultiServer/MultiClient for the ByteBlower Python API. All examples are guaranteed to work with Python 2.7 and above Copyright 2018, Ex<NAME>. """ # Needed for python2 / python3 print function compatibility from __future__ import print_function # import the ByteBlower module import byteblowerl...
""" HTTP MultiServer/MultiClient for the ByteBlower Python API. All examples are guaranteed to work with Python 2.7 and above Copyright 2018, Ex<NAME>. """ # Needed for python2 / python3 print function compatibility from __future__ import print_function # import the ByteBlower module import byteblowerll.byteblower as...
en
0.700649
HTTP MultiServer/MultiClient for the ByteBlower Python API. All examples are guaranteed to work with Python 2.7 and above Copyright 2018, Ex<NAME>. # Needed for python2 / python3 print function compatibility # import the ByteBlower module # Address (IP or FQDN) of the ByteBlower server to use # Configuration for the f...
2.736319
3
tools/pod-xml-to-geojson.py
24-timmarsseglingarna/app
0
4392
#!/usr/bin/env python # Converts a PoD XML file to a GeoJSON file. # # With the --javascript parameter, the generated file is a javascript # file defining a variable 'basePodSpec'. # # Get the PoD XML file from http://dev.24-timmars.nu/PoD/xmlapi_app.php. import xml.etree.ElementTree as etree import argparse import r...
#!/usr/bin/env python # Converts a PoD XML file to a GeoJSON file. # # With the --javascript parameter, the generated file is a javascript # file defining a variable 'basePodSpec'. # # Get the PoD XML file from http://dev.24-timmars.nu/PoD/xmlapi_app.php. import xml.etree.ElementTree as etree import argparse import r...
en
0.769509
#!/usr/bin/env python # Converts a PoD XML file to a GeoJSON file. # # With the --javascript parameter, the generated file is a javascript # file defining a variable 'basePodSpec'. # # Get the PoD XML file from http://dev.24-timmars.nu/PoD/xmlapi_app.php. # points number 9000 and above are not real points; they are use...
2.551452
3
rastervision/plugin.py
carderne/raster-vision
3
4393
import os import json import importlib from pluginbase import PluginBase import rastervision as rv from rastervision.protos.plugin_pb2 import PluginConfig as PluginConfigMsg from rastervision.utils.files import download_if_needed class PluginError(Exception): pass def load_conf_list(s): """Loads a list of...
import os import json import importlib from pluginbase import PluginBase import rastervision as rv from rastervision.protos.plugin_pb2 import PluginConfig as PluginConfigMsg from rastervision.utils.files import download_if_needed class PluginError(Exception): pass def load_conf_list(s): """Loads a list of...
en
0.810658
Loads a list of items from the config. Lists should be comma separated. This takes into account that previous versions of Raster Vision allowed for a `[ "module" ]` like syntax, even though that didn't work for multi-value lists. # A comma separated list of values will be transformed to # having a lis...
2.219731
2
acsm/nnutils/resunet.py
eldar/acsm
52
4394
<filename>acsm/nnutils/resunet.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags import os import os.path as osp import numpy as np import torch import torchvision import torch.nn as nn from torch.autograd import ...
<filename>acsm/nnutils/resunet.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags import os import os.path as osp import numpy as np import torch import torchvision import torch.nn as nn from torch.autograd import ...
none
1
1.968001
2
uproot_methods/common/TVector.py
marinang/uproot-methods
0
4395
<gh_stars>0 #!/usr/bin/env python # Copyright (c) 2018, DIANA-HEP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, th...
#!/usr/bin/env python # Copyright (c) 2018, DIANA-HEP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list ...
en
0.706327
#!/usr/bin/env python # Copyright (c) 2018, DIANA-HEP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of ...
1.644965
2
tpp/controller/ConversionController.py
pennyarcade/TPPP
0
4396
""" Implements a non interactive controller to controt non-interactive visualizers. (i.e. those that are used for converting TPP souce code into another format) """ from tpp.FileParser import FileParser from tpp.controller.TPPController import TPPController class ConversionController(TPPController): """ Impl...
""" Implements a non interactive controller to controt non-interactive visualizers. (i.e. those that are used for converting TPP souce code into another format) """ from tpp.FileParser import FileParser from tpp.controller.TPPController import TPPController class ConversionController(TPPController): """ Impl...
en
0.60221
Implements a non interactive controller to controt non-interactive visualizers. (i.e. those that are used for converting TPP souce code into another format) Implements a non interactive controller to run non-interactive visualizers. (i.e. those that are used for converting TPP source code into another format) Tod...
3.23839
3
scrapers/covid_scraper.py
ZachGeo/covidGR_API
0
4397
from bs4 import BeautifulSoup from datetime import date from lxml import html import requests import re import json class CovidScraper: def __init__(self): self.api_url = 'http://127.0.0.1:5000/covidgr' self.api_sum_url = 'http://127.0.0.1:5000/summary/covidgr' self.api_test_url = 'http://...
from bs4 import BeautifulSoup from datetime import date from lxml import html import requests import re import json class CovidScraper: def __init__(self): self.api_url = 'http://127.0.0.1:5000/covidgr' self.api_sum_url = 'http://127.0.0.1:5000/summary/covidgr' self.api_test_url = 'http://...
none
1
3.068367
3
img/autoeditimg.py
schorsche/css3-imageslider
0
4398
#!/usr/bin/python2.7 import os from PIL import Image DATEI_WEB_GROSSE = 700 def isimg(isitimg): ext = os.path.splitext(isitimg)[1].lower() if ext == ".jpg" or ext == ".png" or ext == ".gif": return True return False def bearbeiten(datei): img = Image.open(datei) wrel = DATEI_WEB_GROSSE / float(img.size[0]) h...
#!/usr/bin/python2.7 import os from PIL import Image DATEI_WEB_GROSSE = 700 def isimg(isitimg): ext = os.path.splitext(isitimg)[1].lower() if ext == ".jpg" or ext == ".png" or ext == ".gif": return True return False def bearbeiten(datei): img = Image.open(datei) wrel = DATEI_WEB_GROSSE / float(img.size[0]) h...
en
0.245645
#!/usr/bin/python2.7
2.77383
3
wow/wow.py
brisberg/Kiri-Cogs
0
4399
import discord from discord.ext import commands class WowCog: """Custom Cog that had commands for WoW Memes""" def __init__(self, bot): self.bot = bot async def _play(self, url, ctx): """Helper for aliasing Play in the Audio module""" audio = self.bot.get_cog('Audio') if ...
import discord from discord.ext import commands class WowCog: """Custom Cog that had commands for WoW Memes""" def __init__(self, bot): self.bot = bot async def _play(self, url, ctx): """Helper for aliasing Play in the Audio module""" audio = self.bot.get_cog('Audio') if ...
en
0.910688
Custom Cog that had commands for WoW Memes Helper for aliasing Play in the Audio module I will not move when Flame Wreath is cast!
2.808394
3