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
streams/blog/migrations/0012_auto_20200928_1212.py
Engerrs/ckan.org
1
9300
<filename>streams/blog/migrations/0012_auto_20200928_1212.py # Generated by Django 3.1.1 on 2020-09-28 12:12 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0011_blogpostpage_featured'), ] operations = [ migratio...
<filename>streams/blog/migrations/0012_auto_20200928_1212.py # Generated by Django 3.1.1 on 2020-09-28 12:12 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0011_blogpostpage_featured'), ] operations = [ migratio...
en
0.755204
# Generated by Django 3.1.1 on 2020-09-28 12:12
1.599594
2
opac/webapp/main/views.py
rafaelpezzuto/opac
0
9301
# coding: utf-8 import logging import requests import mimetypes from io import BytesIO from urllib.parse import urlparse from datetime import datetime, timedelta from collections import OrderedDict from flask_babelex import gettext as _ from flask import ( render_template, abort, current_app, request, ...
# coding: utf-8 import logging import requests import mimetypes from io import BytesIO from urllib.parse import urlparse from datetime import datetime, timedelta from collections import OrderedDict from flask_babelex import gettext as _ from flask import ( render_template, abort, current_app, request, ...
pt
0.817294
# coding: utf-8 Erro recuperável sem que seja necessário modificar o estado dos dados na parte cliente, e.g., timeouts, erros advindos de particionamento de rede etc. Erro do qual não pode ser recuperado sem modificar o estado dos dados na parte cliente, e.g., recurso solicitado não exite, URI inválida etc....
2.024308
2
create_read_write_1/Writing/to_csv.py
CodeXfull/Pandas
0
9302
""" Converter um DataFrame para CSV """ import pandas as pd dataset = pd.DataFrame({'Frutas': ["Abacaxi", "Mamão"], "Nomes": ["Éverton", "Márcia"]}, index=["Linha 1", "Linha 2"]) dataset.to_csv("dataset.csv")
""" Converter um DataFrame para CSV """ import pandas as pd dataset = pd.DataFrame({'Frutas': ["Abacaxi", "Mamão"], "Nomes": ["Éverton", "Márcia"]}, index=["Linha 1", "Linha 2"]) dataset.to_csv("dataset.csv")
pt
0.757614
Converter um DataFrame para CSV
3.387647
3
venv/Lib/site-packages/pygsheets/client.py
13rilliant/Python-CMS
1
9303
<filename>venv/Lib/site-packages/pygsheets/client.py # -*- coding: utf-8 -*-. import re import warnings import os import logging from pygsheets.drive import DriveAPIWrapper from pygsheets.sheet import SheetAPIWrapper from pygsheets.spreadsheet import Spreadsheet from pygsheets.exceptions import SpreadsheetNotFound, N...
<filename>venv/Lib/site-packages/pygsheets/client.py # -*- coding: utf-8 -*-. import re import warnings import os import logging from pygsheets.drive import DriveAPIWrapper from pygsheets.sheet import SheetAPIWrapper from pygsheets.spreadsheet import Spreadsheet from pygsheets.exceptions import SpreadsheetNotFound, N...
en
0.695434
# -*- coding: utf-8 -*-. #]+)') # _domain_pattern = re.compile("(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE) Create or access Google spreadsheets. Exposes members to create new spreadsheets or open existing ones. Use `authorize` to instantiate an instance of this class. >>> import pygsheets >>> c = pyg...
2.441757
2
model/group_contact.py
NatalyAristova/Training_python
0
9304
from sys import maxsize class Group_contact: def __init__(self,firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None, address=None, home=None, mobile=None, work=None, fax=None, email=None, email2=None, email3=None, byear=None, address2=None, pho...
from sys import maxsize class Group_contact: def __init__(self,firstname=None, middlename=None, lastname=None, nickname=None, title=None, company=None, address=None, home=None, mobile=None, work=None, fax=None, email=None, email2=None, email3=None, byear=None, address2=None, pho...
none
1
2.966517
3
test/manual/documents/test_iter_documents.py
membranepotential/mendeley-python-sdk
103
9305
<gh_stars>100-1000 from itertools import islice from test import get_user_session, cassette from test.resources.documents import delete_all_documents, create_document def test_should_iterate_through_documents(): session = get_user_session() delete_all_documents() with cassette('fixtures/resources/docume...
from itertools import islice from test import get_user_session, cassette from test.resources.documents import delete_all_documents, create_document def test_should_iterate_through_documents(): session = get_user_session() delete_all_documents() with cassette('fixtures/resources/documents/iter_documents/...
none
1
2.289405
2
demo.py
cbsudux/minimal-hand
0
9306
<reponame>cbsudux/minimal-hand<filename>demo.py import argparse import cv2 import keyboard import numpy as np import open3d as o3d import os import pygame from transforms3d.axangles import axangle2mat import config from hand_mesh import HandMesh from kinematics import mpii_to_mano from utils import OneEuroFilter, imr...
import argparse import cv2 import keyboard import numpy as np import open3d as o3d import os import pygame from transforms3d.axangles import axangle2mat import config from hand_mesh import HandMesh from kinematics import mpii_to_mano from utils import OneEuroFilter, imresize from wrappers import ModelPipeline from ut...
en
0.344005
############ output visualization ############ # view_mat = axangle2mat([1, 0, 0], np.pi) # align different coordinate systems # window_size = 1080 # hand_mesh = HandMesh(config.HAND_MESH_MODEL_PATH) # mesh = o3d.geometry.TriangleMesh() # mesh.triangles = o3d.utility.Vector3iVector(hand_mesh.faces) # mesh.vertices = \ ...
2.273765
2
test_project/settings.py
incuna/incuna-groups
1
9307
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = True ALLOWED_HOSTS = [] ROOT_URLCONF = 'groups.tests.urls' STATIC_URL = '/static/' SECRET_KEY = '<KEY>' PASSWORD_HASHERS = ('django.contrib.auth.hashers.MD5PasswordHasher',) DATABASES = { 'default':...
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = True ALLOWED_HOSTS = [] ROOT_URLCONF = 'groups.tests.urls' STATIC_URL = '/static/' SECRET_KEY = '<KEY>' PASSWORD_HASHERS = ('django.contrib.auth.hashers.MD5PasswordHasher',) DATABASES = { 'default':...
en
0.846381
# Put contenttypes before auth to work around test issue. # See: https://code.djangoproject.com/ticket/10827#comment:12
1.743116
2
tests/test_akismet.py
cclauss/akismet
9
9308
<gh_stars>1-10 import datetime import os import sys import unittest from unittest import mock import akismet class AkismetTests(unittest.TestCase): api_key = os.getenv("TEST_AKISMET_API_KEY") blog_url = os.getenv("TEST_AKISMET_BLOG_URL") api_key_env_var = "PYTHON_AKISMET_API_KEY" blog_url_env_var = ...
import datetime import os import sys import unittest from unittest import mock import akismet class AkismetTests(unittest.TestCase): api_key = os.getenv("TEST_AKISMET_API_KEY") blog_url = os.getenv("TEST_AKISMET_BLOG_URL") api_key_env_var = "PYTHON_AKISMET_API_KEY" blog_url_env_var = "PYTHON_AKISMET...
en
0.822253
Tests configuration of the Akismet class. Configuring via explicit arguments succeeds. Configuring with bad arguments fails. Configuring via environment variables succeeds. Configuring with bad environment variables fails. Configuring with a bad URL fails. Instantiating without any configuration fails. The Akismet clas...
3.066258
3
experimenting/dataset/datamodule.py
gaurvigoyal/lifting_events_to_3d_hpe
19
9309
<filename>experimenting/dataset/datamodule.py import pytorch_lightning as pl from torch.utils.data import DataLoader, Dataset from .core import BaseCore from .factory import BaseDataFactory class DataModule(pl.LightningDataModule): def __init__( self, dataset_factory: BaseDataFactory, cor...
<filename>experimenting/dataset/datamodule.py import pytorch_lightning as pl from torch.utils.data import DataLoader, Dataset from .core import BaseCore from .factory import BaseDataFactory class DataModule(pl.LightningDataModule): def __init__( self, dataset_factory: BaseDataFactory, cor...
none
1
2.390724
2
sevn-interface/SEVN/resources/SEVN_walkthrough/running_folder/analysis_3_pandas.py
giulianoiorio/PeTar
0
9310
<filename>sevn-interface/SEVN/resources/SEVN_walkthrough/running_folder/analysis_3_pandas.py import pandas as pd import matplotlib.pyplot as plt import numpy as np #Load file dt=pd.read_csv("sevn_output/output_0.csv") #Give a look to the columns print(dt.columns) #Consider only the final states dt=dt.drop_duplicates([...
<filename>sevn-interface/SEVN/resources/SEVN_walkthrough/running_folder/analysis_3_pandas.py import pandas as pd import matplotlib.pyplot as plt import numpy as np #Load file dt=pd.read_csv("sevn_output/output_0.csv") #Give a look to the columns print(dt.columns) #Consider only the final states dt=dt.drop_duplicates([...
en
0.812494
#Load file #Give a look to the columns #Consider only the final states #Load evolved file #Give a look to the columns #After change #Join the two dataset # - on: column(s, can be a list of columns) to match during the merge of the two tables. The colum(s) has(have) to be present in both the tables # - how: type of join...
3.03845
3
apps/tg_bot/apps.py
VladimirLazor/Lohika
0
9311
from django.apps import AppConfig class TgBotConfig(AppConfig): name = 'apps.tg_bot'
from django.apps import AppConfig class TgBotConfig(AppConfig): name = 'apps.tg_bot'
none
1
1.066477
1
office365/sharepoint/portal/group_site_manager.py
rikeshtailor/Office365-REST-Python-Client
0
9312
<reponame>rikeshtailor/Office365-REST-Python-Client from office365.runtime.client_object import ClientObject from office365.runtime.client_result import ClientResult from office365.runtime.http.http_method import HttpMethod from office365.runtime.queries.service_operation_query import ServiceOperationQuery from office3...
from office365.runtime.client_object import ClientObject from office365.runtime.client_result import ClientResult from office365.runtime.http.http_method import HttpMethod from office365.runtime.queries.service_operation_query import ServiceOperationQuery from office365.runtime.resource_path import ResourcePath from of...
en
0.425274
Create a modern site :param str display_name: :param str alias: :param bool is_public: :param office365.sharepoint.portal.group_creation_params.GroupCreationParams or None optional_params: Deletes a SharePoint Team site :type site_url: str Get the status of a SharePoint site ...
2.081246
2
tests/errors/e_tuple_args_T692.py
smok-serwis/cython
2
9313
<reponame>smok-serwis/cython # ticket: 692 # mode: error def func((a, b)): return a + b _ERRORS = u""" 4:9: Missing argument name 5:11: undeclared name not builtin: a 5:15: undeclared name not builtin: b """
# ticket: 692 # mode: error def func((a, b)): return a + b _ERRORS = u""" 4:9: Missing argument name 5:11: undeclared name not builtin: a 5:15: undeclared name not builtin: b """
en
0.656657
# ticket: 692 # mode: error 4:9: Missing argument name 5:11: undeclared name not builtin: a 5:15: undeclared name not builtin: b
2.429293
2
ble.py
Ladvien/esp32_upython_env
0
9314
import bluetooth import time bt = bluetooth.BLE() # singleton bt.active(True) # activate BT stack UART_UUID = bluetooth.UUID('6E400001-B5A3-F393-E0A9-E50E24DCCA9E') UART_TX = (bluetooth.UUID('6E400003-B5A3-F393-E0A9-E50E24DCCA9E'), bluetooth.FLAG_READ | bluetooth.FLAG_NOTIFY,) UAR...
import bluetooth import time bt = bluetooth.BLE() # singleton bt.active(True) # activate BT stack UART_UUID = bluetooth.UUID('6E400001-B5A3-F393-E0A9-E50E24DCCA9E') UART_TX = (bluetooth.UUID('6E400003-B5A3-F393-E0A9-E50E24DCCA9E'), bluetooth.FLAG_READ | bluetooth.FLAG_NOTIFY,) UAR...
en
0.362788
# singleton # activate BT stack
2.309556
2
examples/custom-generator/customer.py
luxbe/sledo
4
9315
<filename>examples/custom-generator/customer.py from random import randint from sledo.generate.field_generators.base import FieldGenerator values = ("Austria", "Belgium", "Bulgaria", "Croatia", "Cyprus", "Czech Republic", "Denmark", "Estonia", ...
<filename>examples/custom-generator/customer.py from random import randint from sledo.generate.field_generators.base import FieldGenerator values = ("Austria", "Belgium", "Bulgaria", "Croatia", "Cyprus", "Czech Republic", "Denmark", "Estonia", ...
none
1
3.165473
3
status-uncertain/baseline_model.py
crawftv/CRAwTO
1
9316
<reponame>crawftv/CRAwTO #!/usr/bin/env python3 from sklearn.metrics import r2_score import numpy as np class BaselineModel(object): def get_params(self): return None def predict(self, X): return np.ones_like(X.index.values) * self._y_pred def score(self, X, y): y_true = y ...
#!/usr/bin/env python3 from sklearn.metrics import r2_score import numpy as np class BaselineModel(object): def get_params(self): return None def predict(self, X): return np.ones_like(X.index.values) * self._y_pred def score(self, X, y): y_true = y y_pred = np.ones_like(y...
fr
0.221828
#!/usr/bin/env python3
2.856769
3
aligner/grow_diag_final.py
ecalder6/MT-HW2
0
9317
import optparse import sys def make_set(data, s, e_vocab, f_vocab, aligned, reverse): for pair in data.split(): cur = pair.split('-') if reverse: e_vocab.add(int(cur[1])) f_vocab.add(int(cur[0])) aligned.add(int(cur[0])) s.add((int(cur[1]), int(cur[0]...
import optparse import sys def make_set(data, s, e_vocab, f_vocab, aligned, reverse): for pair in data.split(): cur = pair.split('-') if reverse: e_vocab.add(int(cur[1])) f_vocab.add(int(cur[0])) aligned.add(int(cur[0])) s.add((int(cur[1]), int(cur[0]...
none
1
2.826631
3
tests/test_tbears_db.py
Transcranial-Solutions/t-bears
35
9318
# -*- coding: utf-8 -*- # Copyright 2017-2018 ICON Foundation # # 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 ...
# -*- coding: utf-8 -*- # Copyright 2017-2018 ICON Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
en
0.826489
# -*- coding: utf-8 -*- # Copyright 2017-2018 ICON Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
2.150286
2
src/exabgp/bgp/message/update/attribute/bgpls/link/mplsmask.py
pierky/exabgp
1,560
9319
# encoding: utf-8 """ mplsmask.py Created by <NAME> on 2016-12-01. Copyright (c) 2014-2017 Exa Networks. All rights reserved. """ from exabgp.bgp.message.notification import Notify from exabgp.bgp.message.update.attribute.bgpls.linkstate import LinkState from exabgp.bgp.message.update.attribute.bgpls.linkstate import ...
# encoding: utf-8 """ mplsmask.py Created by <NAME> on 2016-12-01. Copyright (c) 2014-2017 Exa Networks. All rights reserved. """ from exabgp.bgp.message.notification import Notify from exabgp.bgp.message.update.attribute.bgpls.linkstate import LinkState from exabgp.bgp.message.update.attribute.bgpls.linkstate import ...
en
0.284276
# encoding: utf-8 mplsmask.py Created by <NAME> on 2016-12-01. Copyright (c) 2014-2017 Exa Networks. All rights reserved. # 0 1 2 3 # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...
1.255285
1
tests/test_cecum.py
hsorby/scaffoldmaker
0
9320
import unittest from opencmiss.utils.zinc.finiteelement import evaluateFieldNodesetRange from opencmiss.utils.zinc.general import ChangeManager from opencmiss.zinc.context import Context from opencmiss.zinc.element import Element from opencmiss.zinc.field import Field from opencmiss.zinc.result import RESULT_OK from s...
import unittest from opencmiss.utils.zinc.finiteelement import evaluateFieldNodesetRange from opencmiss.utils.zinc.general import ChangeManager from opencmiss.zinc.context import Context from opencmiss.zinc.element import Element from opencmiss.zinc.field import Field from opencmiss.zinc.result import RESULT_OK from s...
en
0.789202
Test creation of cecum scaffold.
2.120829
2
samples/destroy_vm.py
jm66/pyvmomi-community-samples
4
9321
#!/usr/bin/env python # Copyright 2015 <NAME> <<EMAIL>> # # 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 app...
#!/usr/bin/env python # Copyright 2015 <NAME> <<EMAIL>> # # 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 app...
en
0.830446
#!/usr/bin/env python # Copyright 2015 <NAME> <<EMAIL>> # # 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 app...
2.513161
3
helpers/Screen.py
1000monkeys/MastermindRedux
0
9322
import sys class Screen: def __init__(self) -> None: pass def handle_events(self, events): for event in events: if event.type == self.pygame.QUIT: sys.exit() def draw(self, screen): pass
import sys class Screen: def __init__(self) -> None: pass def handle_events(self, events): for event in events: if event.type == self.pygame.QUIT: sys.exit() def draw(self, screen): pass
none
1
2.622758
3
VirtualStage/BackgroundMatting/fixed_threshold.py
chris-han/ailab
0
9323
<filename>VirtualStage/BackgroundMatting/fixed_threshold.py import os def fixed_split(videos, thresholds, mask_suffix, overlap=0, background_path="/"): # crop target background video frames backgrounds = [os.path.join(background_path, f[:-4]) for f in os.listdir(background_path) if f.endswith(".mp4")] p...
<filename>VirtualStage/BackgroundMatting/fixed_threshold.py import os def fixed_split(videos, thresholds, mask_suffix, overlap=0, background_path="/"): # crop target background video frames backgrounds = [os.path.join(background_path, f[:-4]) for f in os.listdir(background_path) if f.endswith(".mp4")] p...
en
0.538083
# crop target background video frames # crop target background single image # crop color images # crop mask images # video split, merging
2.649339
3
hn2016_falwa/utilities.py
veredsil/hn2016_falwa
0
9324
import numpy as np from math import pi,exp def static_stability(height,area,theta,s_et=None,n_et=None): """ The function "static_stability" computes the vertical gradient (z-derivative) of hemispheric-averaged potential temperature, i.e. d\tilde{theta}/dz in the def- inition of QGPV in eq.(3) of Huang ...
import numpy as np from math import pi,exp def static_stability(height,area,theta,s_et=None,n_et=None): """ The function "static_stability" computes the vertical gradient (z-derivative) of hemispheric-averaged potential temperature, i.e. d\tilde{theta}/dz in the def- inition of QGPV in eq.(3) of Huang ...
en
0.647227
The function "static_stability" computes the vertical gradient (z-derivative) of hemispheric-averaged potential temperature, i.e. d\tilde{theta}/dz in the def- inition of QGPV in eq.(3) of Huang and Nakamura (2016), by central differencing. At the boundary, the static stability is estimated by forward/backw...
3.073622
3
src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_params.py
JennyLawrance/azure-cli
0
9325
<filename>src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_params.py # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for licens...
<filename>src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_params.py # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for licens...
en
0.451115
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1.745245
2
metrics-calculator/tests/integration/test_s3.py
nhsconnect/prm-practice-migration-dashboard
0
9326
<reponame>nhsconnect/prm-practice-migration-dashboard<filename>metrics-calculator/tests/integration/test_s3.py<gh_stars>0 import boto3 import gzip from moto import mock_s3 import pytest import os from chalicelib.s3 import read_object_s3, write_object_s3, objects_exist from tests.builders.file import build_gzip_csv @...
import boto3 import gzip from moto import mock_s3 import pytest import os from chalicelib.s3 import read_object_s3, write_object_s3, objects_exist from tests.builders.file import build_gzip_csv @pytest.fixture(scope='function') def aws_credentials(): """Mocked AWS Credentials for moto.""" os.environ['AWS_ACC...
en
0.693671
Mocked AWS Credentials for moto.
2.12308
2
image_analogy/losses/patch_matcher.py
kaldap/image-analogies
3,722
9327
import numpy as np import scipy.interpolate import scipy.ndimage from sklearn.feature_extraction.image import extract_patches_2d, reconstruct_from_patches_2d def _calc_patch_grid_dims(shape, patch_size, patch_stride): x_w, x_h, x_c = shape num_rows = 1 + (x_h - patch_size) // patch_stride num_cols = 1 + (...
import numpy as np import scipy.interpolate import scipy.ndimage from sklearn.feature_extraction.image import extract_patches_2d, reconstruct_from_patches_2d def _calc_patch_grid_dims(shape, patch_size, patch_stride): x_w, x_h, x_c = shape num_rows = 1 + (x_h - patch_size) // patch_stride num_cols = 1 + (...
en
0.801333
x shape: (num_channels, rows, cols) #patches = np.rollaxis(patches, -1, 2) Reconstruct an image from these `patches` input shape: (rows, cols, channels, patch_row, patch_col) # (patches, channels, pr, pc) # (patches, p, p, channels) A matcher of image patches inspired by the PatchMatch algorithm. image shape:...
2.881291
3
muni_portal/core/migrations/0030_remove_servicerequest_mobile_reference.py
desafinadude/muni-portal-backend
1
9328
<filename>muni_portal/core/migrations/0030_remove_servicerequest_mobile_reference.py<gh_stars>1-10 # Generated by Django 2.2.10 on 2021-02-24 09:42 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0029_auto_20210224_0936'), ] operations = [ ...
<filename>muni_portal/core/migrations/0030_remove_servicerequest_mobile_reference.py<gh_stars>1-10 # Generated by Django 2.2.10 on 2021-02-24 09:42 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0029_auto_20210224_0936'), ] operations = [ ...
en
0.800865
# Generated by Django 2.2.10 on 2021-02-24 09:42
1.30581
1
rllib/agents/ppo/tests/test_appo.py
noahshpak/ray
2
9329
<filename>rllib/agents/ppo/tests/test_appo.py import unittest import ray import ray.rllib.agents.ppo as ppo from ray.rllib.utils.test_utils import check_compute_single_action, \ framework_iterator class TestAPPO(unittest.TestCase): @classmethod def setUpClass(cls): ray.init() @classmethod ...
<filename>rllib/agents/ppo/tests/test_appo.py import unittest import ray import ray.rllib.agents.ppo as ppo from ray.rllib.utils.test_utils import check_compute_single_action, \ framework_iterator class TestAPPO(unittest.TestCase): @classmethod def setUpClass(cls): ray.init() @classmethod ...
en
0.847905
Test whether an APPOTrainer can be built with both frameworks.
2.212034
2
ezeeai/utils/hooks.py
jmarine/ezeeai
19
9330
<reponame>jmarine/ezeeai<filename>ezeeai/utils/hooks.py<gh_stars>10-100 from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.training import session_run_hook from tensorflow.python.training.basic_session_run_hooks import NeverTriggerTimer, ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.training import session_run_hook from tensorflow.python.training.basic_session_run_hooks import NeverTriggerTimer, SecondOrStepTimer from tensorflow.python.training.session_run_hook impor...
en
0.227922
# pylint: disable=unused-argument
2.268078
2
tests/factory_fixtures/dummy_resource.py
whiletrace/dwellinglybackend
15
9331
<filename>tests/factory_fixtures/dummy_resource.py from flask import request from flask_restful import Resource from utils.gatekeeper import allowed_params class DummyResource(Resource): dummy_params = set() @allowed_params(dummy_params) def put(self): return request.json
<filename>tests/factory_fixtures/dummy_resource.py from flask import request from flask_restful import Resource from utils.gatekeeper import allowed_params class DummyResource(Resource): dummy_params = set() @allowed_params(dummy_params) def put(self): return request.json
none
1
1.969477
2
quizzes/00.organize.me/hackerrank/sorted_set/server2.py
JiniousChoi/encyclopedia-in-code
2
9332
#!/usr/bin/env python3 import socket, threading from queue import Queue import sys, struct # NOTE: Use this path to create the UDS Server socket SERVER_SOCKET_PATH = "./socket"; class Result: def __init__(self): self._evt = threading.Event() self._result = None def set_result(self, value...
#!/usr/bin/env python3 import socket, threading from queue import Queue import sys, struct # NOTE: Use this path to create the UDS Server socket SERVER_SOCKET_PATH = "./socket"; class Result: def __init__(self): self._evt = threading.Event() self._result = None def set_result(self, value...
en
0.26388
#!/usr/bin/env python3 # NOTE: Use this path to create the UDS Server socket #add #remove #get size #get value #range #disconnect #worker.close()
2.775195
3
vnpy/gateway/rohon/__init__.py
funrunskypalace/vnpy
323
9333
from .rohon_gateway import RohonGateway
from .rohon_gateway import RohonGateway
none
1
1.070107
1
dnd/mobile/urls.py
dndtools2/dndtools2
0
9334
<filename>dnd/mobile/urls.py<gh_stars>0 from django.conf.urls import patterns, url, include from .views import force_desktop_version, return_to_mobile_version app_name = 'mobile' urlpatterns = [ # force desktop url(r'^force-desktop-version/$', force_desktop_version, name='force_desktop_version'), # retur...
<filename>dnd/mobile/urls.py<gh_stars>0 from django.conf.urls import patterns, url, include from .views import force_desktop_version, return_to_mobile_version app_name = 'mobile' urlpatterns = [ # force desktop url(r'^force-desktop-version/$', force_desktop_version, name='force_desktop_version'), # retur...
en
0.713173
# force desktop # return to mobile version # index # character classes # feats # items # languages # monsters # races # rulebooks # rules # skills # spells # deities
1.751771
2
ros_aruco.py
esteng/guiding-multi-step
69
9335
""" Calibrate with the ROS package aruco_detect """ import rospy import roslib from geometry_msgs.msg import Transform class ROSArUcoCalibrate: def __init__(self, aruco_tag_len=0.0795): print("Please roslaunch roslaunch aruco_detect aruco_detect.launch before you run!") self.aruco_tf_topic = "/f...
""" Calibrate with the ROS package aruco_detect """ import rospy import roslib from geometry_msgs.msg import Transform class ROSArUcoCalibrate: def __init__(self, aruco_tag_len=0.0795): print("Please roslaunch roslaunch aruco_detect aruco_detect.launch before you run!") self.aruco_tf_topic = "/f...
en
0.609418
Calibrate with the ROS package aruco_detect
2.532505
3
utils/utils.py
mmalandra-kb4/service-metrics-gatherer
0
9336
<gh_stars>0 """ * Copyright 2019 EPAM 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 applicable law or agreed to...
""" * Copyright 2019 EPAM 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 applicable law or agreed to in writing,...
en
0.853167
* Copyright 2019 EPAM 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 applicable law or agreed to in writing, sof...
2.387819
2
OSAnalysisHelper.py
nassermarafi/SRCSWArchetypes
7
9337
from __future__ import absolute_import __author__ = 'marafi' def SolutionAlgorithim(OData, Dt, Tol, Steps): #Insert within the While loop, make sure parameter "ok" is defined import OpenSeesAPI OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {')) OData.AddObject(OpenSeesAPI.TCL.TCLScript('put...
from __future__ import absolute_import __author__ = 'marafi' def SolutionAlgorithim(OData, Dt, Tol, Steps): #Insert within the While loop, make sure parameter "ok" is defined import OpenSeesAPI OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {')) OData.AddObject(OpenSeesAPI.TCL.TCLScript('put...
en
0.247052
#Insert within the While loop, make sure parameter "ok" is defined #Insert within the While loop, make sure parameter "ok" is defined #Insert within the While loop, make sure parameter "ok" is defined # OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0)) # OData.AddObject(OpenSeesAPI.TCL.TCLScript('test E...
2.365582
2
unityparser/commands.py
socialpoint-labs/unity-yaml-parser
76
9338
<gh_stars>10-100 import re from argparse import ArgumentParser from multiprocessing import Pool, Manager, Process from pathlib import Path from .utils import UnityDocument YAML_HEADER = '%YAML' class UnityProjectTester: """ Class to run tests on a given Unity project folder """ AVAILABLE_COMMANDS = ...
import re from argparse import ArgumentParser from multiprocessing import Pool, Manager, Process from pathlib import Path from .utils import UnityDocument YAML_HEADER = '%YAML' class UnityProjectTester: """ Class to run tests on a given Unity project folder """ AVAILABLE_COMMANDS = ('test_no_yaml_is...
en
0.83087
Class to run tests on a given Unity project folder # run given function Recurse the whole project folder looking for '.asset' files, load and save them all, and check that there are no modifications # compare regexp against absolute path # signal end of queue with None token # raise the first exception # check ...
2.65053
3
DP/Leetcode 221. Maximal Square.py
kaizhengny/LeetCode
31
9339
class Solution: def maximalSquare(self, matrix: List[List[str]]) -> int: if not matrix: return 0 m, n = len(matrix), len(matrix[0]) dp = [[0]*n for _ in range(m)] res = 0 for i in range(m): dp[i][0] = int(matrix[i][0]) for j in range(n): dp[0][...
class Solution: def maximalSquare(self, matrix: List[List[str]]) -> int: if not matrix: return 0 m, n = len(matrix), len(matrix[0]) dp = [[0]*n for _ in range(m)] res = 0 for i in range(m): dp[i][0] = int(matrix[i][0]) for j in range(n): dp[0][...
none
1
3.001089
3
dokang/harvesters/__init__.py
Polyconseil/dokang
6
9340
# -*- coding: utf-8 -*- # Copyright (c) Polyconseil SAS. All rights reserved. import hashlib import json import logging import os import re from .html import html_config, HtmlHarvester # pylint: disable=unused-import from .sphinx import ( # pylint: disable=unused-import sphinx_config, sphinx_rtd_config, Sph...
# -*- coding: utf-8 -*- # Copyright (c) Polyconseil SAS. All rights reserved. import hashlib import json import logging import os import re from .html import html_config, HtmlHarvester # pylint: disable=unused-import from .sphinx import ( # pylint: disable=unused-import sphinx_config, sphinx_rtd_config, Sph...
en
0.835753
# -*- coding: utf-8 -*- # Copyright (c) Polyconseil SAS. All rights reserved. # pylint: disable=unused-import # pylint: disable=unused-import Harvest a document set and return documents as dictionaries. ``config`` is the harvester configuration. It should contain a key for each supported file extensions. ``has...
2.200569
2
__init__.py
semccomas/string-method-gmxapi
6
9341
__all__ = ["stringmethod"]
__all__ = ["stringmethod"]
none
1
1.228092
1
carPooling/migrations/0018_auto_20190521_1651.py
yangtao4389/pinche
1
9342
# Generated by Django 2.0.4 on 2019-05-21 16:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('carPooling', '0017_carpoolingrecunbook'), ] operations = [ migrations.AlterField( model_name='carpoolinguserconf', n...
# Generated by Django 2.0.4 on 2019-05-21 16:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('carPooling', '0017_carpoolingrecunbook'), ] operations = [ migrations.AlterField( model_name='carpoolinguserconf', n...
en
0.773586
# Generated by Django 2.0.4 on 2019-05-21 16:51
1.520161
2
src/fuckbot/ticker.py
Zer0-One/fuckbot
0
9343
import discord import logging TRADING_API_URL='https://cloud.iexapis.com/stable/stock/{0}/quote' TRADING_API_ICON='https://iextrading.com/favicon.ico' def ticker_embed(symbol): ticker = discord.Embed(title=f"{symbol}".upper(), type="rich", color=3029236, url=TRADING_API_URL.format(symbol)) ticker.set_author(n...
import discord import logging TRADING_API_URL='https://cloud.iexapis.com/stable/stock/{0}/quote' TRADING_API_ICON='https://iextrading.com/favicon.ico' def ticker_embed(symbol): ticker = discord.Embed(title=f"{symbol}".upper(), type="rich", color=3029236, url=TRADING_API_URL.format(symbol)) ticker.set_author(n...
none
1
2.25648
2
minos/lib/util/StateSet.py
johny-c/minos
1
9344
import bz2 import csv import collections import math from enum import Enum class Select(Enum): FIRST = 'first' RANGE_KEY = 'range_key' RANGE_VALUE = 'range_value' class SelectPolicy: def __init__(self, policy, field=None): self.policy = policy self.field = field class StateSet: ...
import bz2 import csv import collections import math from enum import Enum class Select(Enum): FIRST = 'first' RANGE_KEY = 'range_key' RANGE_VALUE = 'range_value' class SelectPolicy: def __init__(self, policy, field=None): self.policy = policy self.field = field class StateSet: ...
en
0.861988
Wrapper for set of episode val/test states Get dictionary of StateSets keyed by scene 'set' i.e. dataset split # Select n states from big list of states # sort by field # sort by field # select by evenly dividing indices # sort by field and get range (value) # print('Range is %f to %f' % (fmin,fmax)) # from range, divi...
2.651506
3
pagetags/configuration/development.py
pmatigakis/pagetags
0
9345
<reponame>pmatigakis/pagetags DEBUG = True TESTING = False
DEBUG = True TESTING = False
none
1
0.99697
1
hpcrocket/pyfilesystem/factory.py
SvenMarcus/hpc-rocket
7
9346
from hpcrocket.core.filesystem import Filesystem, FilesystemFactory from hpcrocket.core.launchoptions import Options from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem from hpcrocket.pyfilesystem.sshfilesystem import SSHFilesystem class PyFilesystemFactory(FilesystemFactory): def __init__(self, o...
from hpcrocket.core.filesystem import Filesystem, FilesystemFactory from hpcrocket.core.launchoptions import Options from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem from hpcrocket.pyfilesystem.sshfilesystem import SSHFilesystem class PyFilesystemFactory(FilesystemFactory): def __init__(self, o...
none
1
2.153482
2
cqlsh_tests/cqlsh_tools.py
vincewhite/cassandra-dtest
0
9347
<gh_stars>0 import csv import random import cassandra from cassandra.cluster import ResultSet from typing import List class DummyColorMap(object): def __getitem__(self, *args): return '' def csv_rows(filename, delimiter=None): """ Given a filename, opens a csv file and yields it line by line....
import csv import random import cassandra from cassandra.cluster import ResultSet from typing import List class DummyColorMap(object): def __getitem__(self, *args): return '' def csv_rows(filename, delimiter=None): """ Given a filename, opens a csv file and yields it line by line. """ ...
en
0.90376
Given a filename, opens a csv file and yields it line by line. Monkeypatches the `cassandra` driver module in the same way that clqsh does. Returns a dictionary containing the original values of the monkeypatched names. Given a dictionary that was used to cache parts of `cassandra` for monkeypatching, resto...
3.009903
3
tests/unit/sagemaker/tensorflow/test_estimator_init.py
LastRemote/sagemaker-python-sdk
1,690
9348
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
en
0.89298
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
1.75947
2
testing.py
sofwerx/mycroft-articlekeyword-skill
0
9349
import subprocess proc = subprocess.Popen(['python3', 'articlekeywords.py', 'aih.txt' , '5'], stdout=subprocess.PIPE ) #print(type(proc.communicate()[0])) # path = '/opt/mycroft/skills/mycroft-bitcoinprice-skill/' text = proc.stdout.read() rows = text.splitlines() #print(text.splitlines()) count = 0 s = "" for ...
import subprocess proc = subprocess.Popen(['python3', 'articlekeywords.py', 'aih.txt' , '5'], stdout=subprocess.PIPE ) #print(type(proc.communicate()[0])) # path = '/opt/mycroft/skills/mycroft-bitcoinprice-skill/' text = proc.stdout.read() rows = text.splitlines() #print(text.splitlines()) count = 0 s = "" for ...
en
0.465532
#print(type(proc.communicate()[0])) # path = '/opt/mycroft/skills/mycroft-bitcoinprice-skill/' #print(text.splitlines()) # with open(path + 'out.csv', 'r') as content_file: # text = content_file.read() # self.speak_dialog("bitcoin.price", data={'price': str(text)}) #file_path = '/opt/mycroft/skills/mycroft-bitcoinp...
2.864502
3
slcyGeneral.py
mirrorcoloured/slcypi
0
9350
# Python 2.7.1 import RPi.GPIO as GPIO from twython import Twython import time import sys import os import pygame APP_KEY='zmmlyAJzMDIntLpDYmSH98gbw' APP_SECRET='<KEY>' OAUTH_TOKEN='<KEY>' OAUTH_TOKEN_SECRET='<KEY>' applepislcy = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) ### GENERAL ### def Clea...
# Python 2.7.1 import RPi.GPIO as GPIO from twython import Twython import time import sys import os import pygame APP_KEY='zmmlyAJzMDIntLpDYmSH98gbw' APP_SECRET='<KEY>' OAUTH_TOKEN='<KEY>' OAUTH_TOKEN_SECRET='<KEY>' applepislcy = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) ### GENERAL ### def Clea...
en
0.586788
# Python 2.7.1 ### GENERAL ### Puts the program to sleep Simple alert function for testing event interrupts Returns the current time Organizes an input into a pin mapping dict mapping <list>, ['IA','IB'] inp <dict>, <list>, <int> {'IA':1,'IB':2}, [1,2] Converts boolean bits into signed bits 0 -> -1 1 ->...
3.002182
3
python/pyarmnn/scripts/generate_docs.py
PetervdPerk-NXP/pyarmnn-release
7
9351
<reponame>PetervdPerk-NXP/pyarmnn-release<gh_stars>1-10 # Copyright © 2019 Arm Ltd. All rights reserved. # Copyright 2020 NXP # SPDX-License-Identifier: MIT import os import tarfile import pyarmnn as ann import shutil from typing import List, Union from pdoc.cli import main package_dir = os.path.join...
# Copyright © 2019 Arm Ltd. All rights reserved. # Copyright 2020 NXP # SPDX-License-Identifier: MIT import os import tarfile import pyarmnn as ann import shutil from typing import List, Union from pdoc.cli import main package_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') d...
en
0.663716
# Copyright © 2019 Arm Ltd. All rights reserved. # Copyright 2020 NXP # SPDX-License-Identifier: MIT Copies multiple files to a directory. Args: file_paths (Union[List(str)]): List of files to copy target_dir_path (str): Target directory. Returns: None Creates an archive. ...
2.372192
2
tests/gejun_sum.py
jeffzhengye/pylearn
2
9352
__author__ = 'jeffye' def sum_consecutives(s): i = 1 li = [] if i < len(s): n = 1 while s[i] != s[i + 1] and s[i] != s[i - 1]: sum = s[i] i = i + 1 return sum while s[i] == s[i + 1]: n = n + 1 sum = s[i] * n i = i + 1 return sum ...
__author__ = 'jeffye' def sum_consecutives(s): i = 1 li = [] if i < len(s): n = 1 while s[i] != s[i + 1] and s[i] != s[i - 1]: sum = s[i] i = i + 1 return sum while s[i] == s[i + 1]: n = n + 1 sum = s[i] * n i = i + 1 return sum ...
en
0.703839
# last element # equal, just record the length # first not equal, sum all previous equal elements and append to li # should return [-10,14,12,0]
3.397416
3
PySDDP/term.py
tscher/PySDDP
9
9353
<filename>PySDDP/term.py class term(object): # Dados de cadastro das usinas termeletrica (presentes no TERM.DAT) Codigo = None Nome = None Potencia = None FCMax = None TEIF = None IP = None GTMin = None # Dados Adicionais Especificados no arquivo de configuracao termica (CONFT) ...
<filename>PySDDP/term.py class term(object): # Dados de cadastro das usinas termeletrica (presentes no TERM.DAT) Codigo = None Nome = None Potencia = None FCMax = None TEIF = None IP = None GTMin = None # Dados Adicionais Especificados no arquivo de configuracao termica (CONFT) ...
pt
0.52758
# Dados de cadastro das usinas termeletrica (presentes no TERM.DAT) # Dados Adicionais Especificados no arquivo de configuracao termica (CONFT) # Dados Adicionais Especificados no arquivo de classe termica (CLAST)
2.323335
2
plerr/__main__.py
b2bs-team/pylint-errors
2
9354
"""plerr entrypoint""" from plerr import cli if __name__ == '__main__': cli.main()
"""plerr entrypoint""" from plerr import cli if __name__ == '__main__': cli.main()
eu
0.192871
plerr entrypoint
1.205007
1
code/send.py
CamouOkau/messenger_new_years_bot
0
9355
<filename>code/send.py import sys import time from datetime import datetime from bot import FbMessengerBot if __name__ == "__main__": if len(sys.argv) < 3: print("No email or password provided") else: bot = FbMessengerBot(sys.argv[1], sys.argv[2]) with open("users.txt", "r") as file: ...
<filename>code/send.py import sys import time from datetime import datetime from bot import FbMessengerBot if __name__ == "__main__": if len(sys.argv) < 3: print("No email or password provided") else: bot = FbMessengerBot(sys.argv[1], sys.argv[2]) with open("users.txt", "r") as file: ...
none
1
2.603909
3
senlin_tempest_plugin/api/policies/test_policy_update_negative.py
ghanshyammann/senlin-tempest-plugin
0
9356
# 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, software # distributed under t...
# 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, software # distributed under t...
en
0.863182
# 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, software # distributed under t...
1.72174
2
boa3_test/test_sc/interop_test/contract/DestroyContract.py
hal0x2328/neo3-boa
25
9357
<gh_stars>10-100 from boa3.builtin import public from boa3.builtin.interop.contract import destroy_contract @public def Main(): destroy_contract()
from boa3.builtin import public from boa3.builtin.interop.contract import destroy_contract @public def Main(): destroy_contract()
none
1
1.292105
1
tests/test_vmax.py
qinfeng2011/wltp
0
9358
<reponame>qinfeng2011/wltp<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 European Commission (JRC); # Licensed under the EUPL (the 'Licence'); # You may not use this work except in compliance with the Licence. # You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 European Commission (JRC); # Licensed under the EUPL (the 'Licence'); # You may not use this work except in compliance with the Licence. # You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl import functools as fnt import logging impo...
en
0.653608
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 European Commission (JRC); # Licensed under the EUPL (the 'Licence'); # You may not use this work except in compliance with the Licence. # You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl # DEBUG: to reduce clutter in the console. #...
2.146297
2
util/canonicaljson.py
giuseppe/quay
2,027
9359
<reponame>giuseppe/quay import collections def canonicalize(json_obj, preserve_sequence_order=True): """ This function canonicalizes a Python object that will be serialized as JSON. Example usage: json.dumps(canonicalize(my_obj)) Args: json_obj (object): the Python object that will later be ser...
import collections def canonicalize(json_obj, preserve_sequence_order=True): """ This function canonicalizes a Python object that will be serialized as JSON. Example usage: json.dumps(canonicalize(my_obj)) Args: json_obj (object): the Python object that will later be serialized as JSON. Re...
en
0.799362
This function canonicalizes a Python object that will be serialized as JSON. Example usage: json.dumps(canonicalize(my_obj)) Args: json_obj (object): the Python object that will later be serialized as JSON. Returns: object: json_obj now sorted to its canonical form.
3.803853
4
datasette_plugin_geo/inspect.py
russss/datasette-geo
9
9360
from datasette import hookimpl from datasette.utils import detect_spatialite from shapely import wkt def get_spatial_tables(conn): if not detect_spatialite(conn): return {} spatial_tables = {} c = conn.cursor() c.execute( """SELECT f_table_name, f_geometry_column, srid, spatial_index_...
from datasette import hookimpl from datasette.utils import detect_spatialite from shapely import wkt def get_spatial_tables(conn): if not detect_spatialite(conn): return {} spatial_tables = {} c = conn.cursor() c.execute( """SELECT f_table_name, f_geometry_column, srid, spatial_index_...
en
0.162458
SELECT f_table_name, f_geometry_column, srid, spatial_index_enabled FROM geometry_columns
2.358982
2
microcosm_pubsub/context.py
Sinon/microcosm-pubsub
5
9361
""" Message context. """ from typing import Dict from microcosm.api import defaults, typed from microcosm.config.types import boolean from microcosm_logging.decorators import logger from microcosm_pubsub.constants import TTL_KEY, URI_KEY from microcosm_pubsub.message import SQSMessage @defaults( enable_ttl=typ...
""" Message context. """ from typing import Dict from microcosm.api import defaults, typed from microcosm.config.types import boolean from microcosm_logging.decorators import logger from microcosm_pubsub.constants import TTL_KEY, URI_KEY from microcosm_pubsub.message import SQSMessage @defaults( enable_ttl=typ...
en
0.748185
Message context. Factory for per-message contexts. Create a new context from a message. # include the message id # include the TTL (if enabled) # include the URI (if there is one)
2.289917
2
azure_ml/pytorch_classifier/train_parameterized.py
murdockcrc/python-tricks
0
9362
<gh_stars>0 import os import argparse import torch import torch.optim as optim import torchvision import torchvision.transforms as transforms from model import Net from azureml.core import Run run = Run.get_context() if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( '--data...
import os import argparse import torch import torch.optim as optim import torchvision import torchvision.transforms as transforms from model import Net from azureml.core import Run run = Run.get_context() if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( '--data_path', ...
en
0.465789
# prepare DataLoader for CIFAR10 data # define convolutional network # set up pytorch loss / optimizer # train the network # unpack the data # zero the parameter gradients # forward + backward + optimize # print statistics # log loss metric to AML
2.51908
3
src/tests/test_app_db.py
kazqvaizer/arq-sqlalchemy-boilerplate
6
9363
import pytest from app.db import session_scope pytestmark = pytest.mark.asyncio async def test_engine_configured(env): async with session_scope() as session: assert str(session.bind.engine.url) == env("SQLALCHEMY_DATABASE_URI")
import pytest from app.db import session_scope pytestmark = pytest.mark.asyncio async def test_engine_configured(env): async with session_scope() as session: assert str(session.bind.engine.url) == env("SQLALCHEMY_DATABASE_URI")
none
1
2.056562
2
catalyst/core/callbacks/formatters.py
cgarciae/catalyst
1
9364
<gh_stars>1-10 from abc import ABC, abstractmethod from datetime import datetime import json import logging from catalyst import utils from catalyst.core import _State class MetricsFormatter(ABC, logging.Formatter): """ Abstract metrics formatter """ def __init__(self, message_prefix): """ ...
from abc import ABC, abstractmethod from datetime import datetime import json import logging from catalyst import utils from catalyst.core import _State class MetricsFormatter(ABC, logging.Formatter): """ Abstract metrics formatter """ def __init__(self, message_prefix): """ Args: ...
en
0.703113
Abstract metrics formatter Args: message_prefix: logging format string that will be prepended to message Format message string # noinspection PyUnresolvedReferences Translate batch metrics in human-readable format. This class is used by ``logging.Logger`` to make a string from record. ...
2.949586
3
fuzzy/fuzzy.py
Suraj1127/fuzzy-matcher
0
9365
#!/usr/bin/env python3 """ Description: Python script to append the common columns in one sheet from another sheet using fuzzy matching. """ import pip def import_or_install(package): try: __import__(package) except ImportError: pip.main(['install', package]) import os import sys im...
#!/usr/bin/env python3 """ Description: Python script to append the common columns in one sheet from another sheet using fuzzy matching. """ import pip def import_or_install(package): try: __import__(package) except ImportError: pip.main(['install', package]) import os import sys im...
en
0.69875
#!/usr/bin/env python3 Description: Python script to append the common columns in one sheet from another sheet using fuzzy matching. FuzzyMatcher class to perform the fuzzy matching. The constructor takes five arguments. The last argument 'append_in' is optional. Parameters: df_1: the first tab...
3.705154
4
exoatlas/visualizations/panels/BubblePanel.py
zkbt/exopop
4
9366
<filename>exoatlas/visualizations/panels/BubblePanel.py<gh_stars>1-10 from .Panel import * __all__ = ['BubblePanel'] default_size = plt.matplotlib.rcParams['lines.markersize']**2 class BubblePanel(Panel): ''' BubblePanel is a general wrapper for making scatter plots where planets are represented as bubbl...
<filename>exoatlas/visualizations/panels/BubblePanel.py<gh_stars>1-10 from .Panel import * __all__ = ['BubblePanel'] default_size = plt.matplotlib.rcParams['lines.markersize']**2 class BubblePanel(Panel): ''' BubblePanel is a general wrapper for making scatter plots where planets are represented as bubbl...
en
0.739136
BubblePanel is a general wrapper for making scatter plots where planets are represented as bubbles that can have informative sizes and/or colors. Initialize a plotting panel. Parameters ---------- size : PlottableAxis, str, float, None What should the sizes of points be or e...
3.119005
3
venv/lib/python2.7/dist-packages/landscape/sysinfo/load.py
pengwu/scapy_env
0
9367
import os from twisted.internet.defer import succeed class Load(object): def register(self, sysinfo): self._sysinfo = sysinfo def run(self): self._sysinfo.add_header("System load", str(os.getloadavg()[0])) return succeed(None)
import os from twisted.internet.defer import succeed class Load(object): def register(self, sysinfo): self._sysinfo = sysinfo def run(self): self._sysinfo.add_header("System load", str(os.getloadavg()[0])) return succeed(None)
none
1
2.063761
2
src/boh_api/viewsets.py
dougmorato/bag-of-holding
0
9368
<filename>src/boh_api/viewsets.py from rest_framework import viewsets from boh import models from . import serializers class OrganizationViewSet(viewsets.ModelViewSet): queryset = models.Organization.objects.all() serializer_class = serializers.OrganizationSerializer class ApplicationViewSet(viewsets.Mode...
<filename>src/boh_api/viewsets.py from rest_framework import viewsets from boh import models from . import serializers class OrganizationViewSet(viewsets.ModelViewSet): queryset = models.Organization.objects.all() serializer_class = serializers.OrganizationSerializer class ApplicationViewSet(viewsets.Mode...
none
1
1.870128
2
githubintro-fe2d832af2bad7d6b27d036c205cc9d8414b2183/CommunicationAnimation.py
TatendaNoreen/Python
0
9369
import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot import agentframework import csv import matplotlib.animation #create environment in which agents will operate environment=[] #read csv downloaded file f = open('in.txt', newline='') reader = csv.reader(f, quoting=csv.QUOTE_NONNUMERIC) for row in ...
import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot import agentframework import csv import matplotlib.animation #create environment in which agents will operate environment=[] #read csv downloaded file f = open('in.txt', newline='') reader = csv.reader(f, quoting=csv.QUOTE_NONNUMERIC) for row in ...
en
0.864358
#create environment in which agents will operate #read csv downloaded file # A list of rows # A list of value #print(value) # Floats # Don't close until you are done with the reader; # the data is read on request. #def distance_between(agents_row_a, agents_row_b): # return (((agents_row_a.x - agents_row_b.x)**2)...
3.709414
4
external/model-preparation-algorithm/tests/conftest.py
opencv/openvino_training_extensions
775
9370
<reponame>opencv/openvino_training_extensions<filename>external/model-preparation-algorithm/tests/conftest.py # Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # try: import e2e.fixtures from e2e.conftest_utils import * # noqa from e2e.conftest_utils import pytest_addopt...
# Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # try: import e2e.fixtures from e2e.conftest_utils import * # noqa from e2e.conftest_utils import pytest_addoption as _e2e_pytest_addoption # noqa from e2e import config # noqa from e2e.utils import get_plugins_...
en
0.321773
# Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # noqa # noqa # noqa # pytest magic
1.79058
2
ibis/udf/validate.py
rtpsw/ibis
986
9371
"""Validation for UDFs. Warning: This is an experimental module and API here can change without notice. DO NOT USE DIRECTLY. """ from inspect import Parameter, Signature, signature from typing import Any, Callable, List import ibis.common.exceptions as com from ibis.expr.datatypes import DataType def _parameter_c...
"""Validation for UDFs. Warning: This is an experimental module and API here can change without notice. DO NOT USE DIRECTLY. """ from inspect import Parameter, Signature, signature from typing import Any, Callable, List import ibis.common.exceptions as com from ibis.expr.datatypes import DataType def _parameter_c...
en
0.463312
Validation for UDFs. Warning: This is an experimental module and API here can change without notice. DO NOT USE DIRECTLY. Get the number of positional-or-keyword or position-only parameters in a function signature. Parameters ---------- funcsig : inspect.Signature A UDF signature Returns...
3.176635
3
packages/stattik/stattik/schema/schema.py
stattikcms/stattik
1
9372
import inspect from ariadne import make_executable_schema, QueryType, MutationType, SubscriptionType from .resolver import * # # Schema # class GrammarError(Exception): pass keywords = ['query', 'mutation', 'subscription', 'source'] class SchemaMetaDict(dict): ''' Dictionary that allows decorated sche...
import inspect from ariadne import make_executable_schema, QueryType, MutationType, SubscriptionType from .resolver import * # # Schema # class GrammarError(Exception): pass keywords = ['query', 'mutation', 'subscription', 'source'] class SchemaMetaDict(dict): ''' Dictionary that allows decorated sche...
en
0.671376
# # Schema # Dictionary that allows decorated schema entry functions to be overloaded #if key not in self and key.isupper() and key[:1] != '_': #del attributes['_'] Collect all of the tagged grammar entries # Collect all of the entry functions from the class definition #entry = Resolver(name, func, prodname=prodname, f...
2.320187
2
toontown/battle/DistributedBattleBaseAI.py
DankMickey/Project-Altis-Educational-Source
1
9373
import random from otp.ai.AIBase import * from direct.distributed.ClockDelta import * from toontown.battle.BattleBase import * from toontown.battle.BattleCalculatorAI import * from toontown.toonbase.ToontownBattleGlobals import * from toontown.battle.SuitBattleGlobals import * from pandac.PandaModules import * from too...
import random from otp.ai.AIBase import * from direct.distributed.ClockDelta import * from toontown.battle.BattleBase import * from toontown.battle.BattleCalculatorAI import * from toontown.toonbase.ToontownBattleGlobals import * from toontown.battle.SuitBattleGlobals import * from pandac.PandaModules import * from too...
en
0.592317
#TODO: fixme #disconnectCode = self.air.getAvatarDisconnectReason(avId) #userAborted = disconnectCode == ToontownGlobals.DisconnectCloseWindow #TODO: fixme #Not allowed to fire, force them to pass >:D #Allowed to fire
1.766072
2
tracking_test.py
HsunGong/Augmented-Advertisement
5
9374
# Copyright (c) Group Three-Forest SJTU. All Rights Reserved. from tracking.tracking import * # a = tracking_video_rectangle("video/","1.mp4",[[273,352],[266,616],[412,620],[416,369]]) a = tracking_video_rectangle_tovideo("video/","1.mp4", "1.png", [[273,352],[266,616],[412,620],[416,369]], result = 'result__.a...
# Copyright (c) Group Three-Forest SJTU. All Rights Reserved. from tracking.tracking import * # a = tracking_video_rectangle("video/","1.mp4",[[273,352],[266,616],[412,620],[416,369]]) a = tracking_video_rectangle_tovideo("video/","1.mp4", "1.png", [[273,352],[266,616],[412,620],[416,369]], result = 'result__.a...
en
0.701191
# Copyright (c) Group Three-Forest SJTU. All Rights Reserved. # a = tracking_video_rectangle("video/","1.mp4",[[273,352],[266,616],[412,620],[416,369]])
1.590424
2
gym_flock/envs/old/flocking_position.py
katetolstaya/gym-flock
19
9375
import gym from gym import spaces, error, utils from gym.utils import seeding import numpy as np from scipy.spatial.distance import pdist, squareform import configparser from os import path import matplotlib.pyplot as plt from matplotlib.pyplot import gca font = {'family' : 'sans-serif', 'weight' : 'bold', ...
import gym from gym import spaces, error, utils from gym.utils import seeding import numpy as np from scipy.spatial.distance import pdist, squareform import configparser from os import path import matplotlib.pyplot as plt from matplotlib.pyplot import gca font = {'family' : 'sans-serif', 'weight' : 'bold', ...
en
0.763549
# 0.5 * self.v_max # number of features and outputs # outputs # TODO # self.b = np.ones((self.n_nodes,1)) # self.action_space = spaces.Box(low=-self.max_accel, high=self.max_accel, shape=(self.n_nodes, 2), dtype=np.float32 ) # self.observation_space = spaces.Box(low=-self.max_z, high=self.max_z, shape=( # self.n_nodes,...
2.221015
2
conf/constants.py
codingwangfeng/GoodGoodName
0
9376
# -*-coding:utf-8-*- # from functools import reduce from functools import reduce SANCAI_jixiang = [1, 3, 5, 7, 8, 11, 13, 15, 16, 18, 21, 23, 24, 25, 31, 32, 33, 35, 37, 39, 41, 45, 47, 48, 52, 57, 61, 63, 65, 67, 68, 81] # 吉祥运暗示数(代表健全,幸福,名誉等) SANCAI_xiaoji = [6, 17, 26, 27, 29, 30,...
# -*-coding:utf-8-*- # from functools import reduce from functools import reduce SANCAI_jixiang = [1, 3, 5, 7, 8, 11, 13, 15, 16, 18, 21, 23, 24, 25, 31, 32, 33, 35, 37, 39, 41, 45, 47, 48, 52, 57, 61, 63, 65, 67, 68, 81] # 吉祥运暗示数(代表健全,幸福,名誉等) SANCAI_xiaoji = [6, 17, 26, 27, 29, 30,...
zh
0.838995
# -*-coding:utf-8-*- # from functools import reduce # 吉祥运暗示数(代表健全,幸福,名誉等) # 次吉祥运暗示数(代表多少有些障碍,但能获得吉运) # 凶数运暗示数(代表逆境,沉浮,薄弱,病难,困难,多灾等) # 首领运暗示数(智慧 )仁勇全备,立上位,能领导众人) # 财富运暗示数(多钱财,富贵,白手可获巨财) # 艺能运暗示数(富有艺术天才,对审美,艺术,演艺,体育有通达之能) # 女德运暗示数(具有妇德,品性温良,助夫爱子) # 女性孤寡运暗示数(难觅夫君,家庭不和,夫妻两虎相斗,离婚,严重者夫妻一方早亡) # 孤独运暗示数(妻凌夫或夫克妻) # 双妻运暗示数 # 刚情运暗...
2.101429
2
main/migrations/0006_labourer_allproj.py
kevinmuturi5/farm-Management-system
1
9377
<filename>main/migrations/0006_labourer_allproj.py # Generated by Django 3.1.2 on 2020-10-18 16:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0005_auto_20201018_1902'), ] operations = [ migrations.AddField( mode...
<filename>main/migrations/0006_labourer_allproj.py # Generated by Django 3.1.2 on 2020-10-18 16:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0005_auto_20201018_1902'), ] operations = [ migrations.AddField( mode...
en
0.834864
# Generated by Django 3.1.2 on 2020-10-18 16:07
1.460993
1
bzt/modules/blazemeter/blazemeter_reporter.py
beachwood23/taurus
0
9378
<reponame>beachwood23/taurus """ Module for reporting into http://www.blazemeter.com/ service Copyright 2015 BlazeMeter 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.or...
""" Module for reporting into http://www.blazemeter.com/ service Copyright 2015 BlazeMeter 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 Unles...
en
0.78294
Module for reporting into http://www.blazemeter.com/ service Copyright 2015 BlazeMeter 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 re...
1.566295
2
nitorch/nn/losses/_spatial.py
wyli/nitorch
1
9379
""" Losses that assume an underlying spatial organization (gradients, curvature, etc.) """ import torch import torch.nn as tnn from nitorch.core.pyutils import make_list, prod from nitorch.core.utils import slice_tensor from nitorch.spatial import diff1d from ._base import Loss class LocalFeatures(tnn.Module): "...
""" Losses that assume an underlying spatial organization (gradients, curvature, etc.) """ import torch import torch.nn as tnn from nitorch.core.pyutils import make_list, prod from nitorch.core.utils import slice_tensor from nitorch.spatial import diff1d from ._base import Loss class LocalFeatures(tnn.Module): "...
en
0.746772
Losses that assume an underlying spatial organization (gradients, curvature, etc.) Base class for feature extractors. Is it really useful? Parameters ---------- bound : BoundType, default='dct2' Boundary conditions, used to compute derivatives at the edges. voxel_size : float or...
2.42972
2
items/models.py
roberthtamayose/digitalmenu
0
9380
<reponame>roberthtamayose/digitalmenu<gh_stars>0 from django.db import models from django.utils import timezone class Categoria(models.Model): nome = models.CharField(max_length=255) def __str__(self): return self.nome class Item(models.Model): nome = models.CharField(max_length=255) data_c...
from django.db import models from django.utils import timezone class Categoria(models.Model): nome = models.CharField(max_length=255) def __str__(self): return self.nome class Item(models.Model): nome = models.CharField(max_length=255) data_criacao = models.DateTimeField(default=timezone.no...
none
1
2.273124
2
app/services/__init__.py
zeroday0619/XenXenXenSe
1
9381
from app.services.console import Console from app.services.server import Server __main__ = ["server", "console"]
from app.services.console import Console from app.services.server import Server __main__ = ["server", "console"]
none
1
1.127339
1
launch/twist_mux_launch.py
nuclearsandwich-ros/twist_mux-release
31
9382
#!/usr/bin/env python3 # Copyright 2020 Gaitech Korea Co., 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 appli...
#!/usr/bin/env python3 # Copyright 2020 Gaitech Korea Co., 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 appli...
en
0.826262
#!/usr/bin/env python3 # Copyright 2020 Gaitech Korea Co., 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 appli...
1.925896
2
Tests/testLiveService.py
psu-capstone-teamD/ElementalAuth
2
9383
import sys import unittest import requests_mock from mock import patch sys.path.append('services/LiveService') from LiveService import LiveService L = LiveService() baseURL = "https://yanexx65s8e1.live.elementalclouddev.com/api" class LiveServiceTest(unittest.TestCase): '''@patch('services.LiveService.LiveSe...
import sys import unittest import requests_mock from mock import patch sys.path.append('services/LiveService') from LiveService import LiveService L = LiveService() baseURL = "https://yanexx65s8e1.live.elementalclouddev.com/api" class LiveServiceTest(unittest.TestCase): '''@patch('services.LiveService.LiveSe...
en
0.215627
@patch('services.LiveService.LiveService.time', return_value=1502345833) def testSetHeaders(self, mock_time): headers = L.setHeaders("/schedules") self.assertEqual(headers, {'X-Auth-Expires': '1502345863', 'X-Auth-Key': '9c9a72cd3a8feec48539f1943afbef8d', ...
2.67274
3
tests/models/test_stacking.py
LionelMassoulard/aikit
0
9384
<reponame>LionelMassoulard/aikit # -*- coding: utf-8 -*- """ Created on Fri Sep 14 11:49:10 2018 @author: <NAME> """ import pytest import numpy as np import pandas as pd from sklearn.base import is_regressor, is_classifier from sklearn.exceptions import NotFittedError from sklearn.model_selection import KFold from...
# -*- coding: utf-8 -*- """ Created on Fri Sep 14 11:49:10 2018 @author: <NAME> """ import pytest import numpy as np import pandas as pd from sklearn.base import is_regressor, is_classifier from sklearn.exceptions import NotFittedError from sklearn.model_selection import KFold from sklearn.ensemble import RandomFo...
en
0.765778
# -*- coding: utf-8 -*- Created on Fri Sep 14 11:49:10 2018 @author: <NAME> # vector should be different # vector should be different # Approx cross val and fit transform should return the same thing here # Approx cross val and fit transform should return the same thing here
2.295985
2
employee/views/check_rental.py
odrolliv13/Hex-Photos
0
9385
<reponame>odrolliv13/Hex-Photos from django import forms from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404 from manager import models as pmod from . import templater from django.conf import settings import decimal, datetime # This view will display all users a...
from django import forms from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404 from manager import models as pmod from . import templater from django.conf import settings import decimal, datetime # This view will display all users and then on a new page display al...
en
0.736795
# This view will display all users and then on a new page display all the current rentals for a given user #This form will display all users #From here the page will redirect to show all the current rentals for the user picked
2.376353
2
jupyter/settings.py
nguyenngtt/GSE---TEAM-A
3
9386
import pandas as pd import numpy as np import os import logging # suppress warnings import warnings; warnings.filterwarnings('ignore'); from tqdm.autonotebook import tqdm # register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm` tqdm.pandas() # https://pandas.pydata.org/pandas-docs/stable/user_g...
import pandas as pd import numpy as np import os import logging # suppress warnings import warnings; warnings.filterwarnings('ignore'); from tqdm.autonotebook import tqdm # register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm` tqdm.pandas() # https://pandas.pydata.org/pandas-docs/stable/user_g...
en
0.324311
# suppress warnings # register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm` # https://pandas.pydata.org/pandas-docs/stable/user_guide/options.html#available-options # adjust pandas display # default 20 # default 60 # pd.options.display.precision = 2 # default 50; None = all # Number of array items ...
2.141716
2
var/spack/repos/builtin/packages/py-cyvcf2/package.py
jeanbez/spack
0
9387
<filename>var/spack/repos/builtin/packages/py-cyvcf2/package.py # Copyright 2013-2022 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.package import * class PyCyvcf2(PythonPackage...
<filename>var/spack/repos/builtin/packages/py-cyvcf2/package.py # Copyright 2013-2022 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.package import * class PyCyvcf2(PythonPackage...
en
0.648946
# Copyright 2013-2022 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) fast vcf parsing with cython + htslib
1.573296
2
pset_functions/db_search/p1.py
mottaquikarim/pydev-psets
5
9388
""" GPA Calculator """ # Write a function called "simple_gpa" to find GPA when student enters a letter grade as a string. Assign the result to a variable called "gpa". """ Use these conversions: A+ --> 4.0 A --> 4.0 A- --> 3.7 B+ --> 3.3 B --> 3.0 B- --> 2.7 C+ --> 2.3 C --> 2.0 C- --> 1.7 D+ --> 1.3 D --> 1.0 D- -->...
""" GPA Calculator """ # Write a function called "simple_gpa" to find GPA when student enters a letter grade as a string. Assign the result to a variable called "gpa". """ Use these conversions: A+ --> 4.0 A --> 4.0 A- --> 3.7 B+ --> 3.3 B --> 3.0 B- --> 2.7 C+ --> 2.3 C --> 2.0 C- --> 1.7 D+ --> 1.3 D --> 1.0 D- -->...
en
0.656525
GPA Calculator # Write a function called "simple_gpa" to find GPA when student enters a letter grade as a string. Assign the result to a variable called "gpa". Use these conversions: A+ --> 4.0 A --> 4.0 A- --> 3.7 B+ --> 3.3 B --> 3.0 B- --> 2.7 C+ --> 2.3 C --> 2.0 C- --> 1.7 D+ --> 1.3 D --> 1.0 D- --> 0.7 F --> 0.0
3.773573
4
test_soundcard.py
flying-sheep/SoundCard
1
9389
import sys import soundcard import numpy import pytest ones = numpy.ones(1024) signal = numpy.concatenate([[ones], [-ones]]).T def test_speakers(): for speaker in soundcard.all_speakers(): assert isinstance(speaker.name, str) assert hasattr(speaker, 'id') assert isinstance(speaker.channels...
import sys import soundcard import numpy import pytest ones = numpy.ones(1024) signal = numpy.concatenate([[ones], [-ones]]).T def test_speakers(): for speaker in soundcard.all_speakers(): assert isinstance(speaker.name, str) assert hasattr(speaker, 'id') assert isinstance(speaker.channels...
en
0.794081
# must install https://www.vb-audio.com/Cable/index.htm # must install soundflower # pacmd load-module module-null-sink channels=6 rate=48000 # must install https://www.vb-audio.com/Cable/index.htm # must install soundflower # unmapped channels on linux are filled with the mean of other channels # something like zero
2.412843
2
Last 3 digits of 11^x.py
jaiveergill/Last-Three-Digits-of-11-x
0
9390
# This is a simple program to find the last three digits of 11 raised to any given number. # The main algorithm that does the work is on line 10 def trim_num(num): if len(str(num)) > 3: # no need to trim if the number is 3 or less digits long return str(num)[(len(str(num)) - 3):] # trims the number ret...
# This is a simple program to find the last three digits of 11 raised to any given number. # The main algorithm that does the work is on line 10 def trim_num(num): if len(str(num)) > 3: # no need to trim if the number is 3 or less digits long return str(num)[(len(str(num)) - 3):] # trims the number ret...
en
0.895495
# This is a simple program to find the last three digits of 11 raised to any given number. # The main algorithm that does the work is on line 10 # no need to trim if the number is 3 or less digits long # trims the number # The main algorithm which needs to be cleaned (only the last three digits should be shown) # To us...
4.272123
4
osr_odometry/scripts/osr_odom_ackerman2.py
ljb2208/osr-rover-code
0
9391
<filename>osr_odometry/scripts/osr_odom_ackerman2.py #!/usr/bin/env python import time from osr_msgs.msg import Joystick, Commands, Encoder, RunStop from nav_msgs.msg import Odometry from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3 import rospy import tf import math import numpy class Odometry2():...
<filename>osr_odometry/scripts/osr_odom_ackerman2.py #!/usr/bin/env python import time from osr_msgs.msg import Joystick, Commands, Encoder, RunStop from nav_msgs.msg import Odometry from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3 import rospy import tf import math import numpy class Odometry2():...
en
0.639307
#!/usr/bin/env python # distance between wheels # calculate radius of turn # print ("lv: " + str(lv)) # calculate angle change # dth = (dRight - dLeft) / self.wheelTrack # calculate centre of turn circle # calculate new co-ordinates #calculate change in x,y values # convert to ros co-ords # mpt = rospy.get_param("/odom...
2.148301
2
src/simulation-conditioning/utilities/data-generation-scripts/Wavefield_Marmousi_pml_401x301_1000-1287_120-232_4k_20kp100_A_train.py
alisiahkoohi/importance-of-transfer-learning
0
9392
import numpy as np import h5py import os from devito.logger import info from devito import TimeFunction, clear_cache from examples.seismic.acoustic import AcousticWaveSolver from examples.seismic import Model, RickerSource, Receiver, TimeAxis from math import floor from scipy.interpolate import griddata import argparse...
import numpy as np import h5py import os from devito.logger import info from devito import TimeFunction, clear_cache from examples.seismic.acoustic import AcousticWaveSolver from examples.seismic import Model, RickerSource, Receiver, TimeAxis from math import floor from scipy.interpolate import griddata import argparse...
en
0.824598
# Define your vp in km/sec (x, z) # vp = vp[400:1401, 0:401] # nx, ny = shape[0], shape[1] # create model # Derive timestepping from model spacing # Number of timesteps # Discretized time axis
1.863713
2
facto.py
divine-coder/CODECHEF-PYTHON
0
9393
<reponame>divine-coder/CODECHEF-PYTHON import math if __name__=='__main__': n=(int)(input()) for abc in range(n): t=(int)(input()) print math.factorial(t)
import math if __name__=='__main__': n=(int)(input()) for abc in range(n): t=(int)(input()) print math.factorial(t)
none
1
3.535951
4
setup.py
johnmartingodo/pyKinematicsKineticsToolbox
0
9394
from setuptools import setup setup(name="pykinematicskineticstoolbox", version="0.0", description="Installable python package which collects useful kinematics and kinetics functions", author="<NAME>", author_email="<EMAIL>", license="MIT", packages=["pykinematicskineticstoolbox"], install_requires...
from setuptools import setup setup(name="pykinematicskineticstoolbox", version="0.0", description="Installable python package which collects useful kinematics and kinetics functions", author="<NAME>", author_email="<EMAIL>", license="MIT", packages=["pykinematicskineticstoolbox"], install_requires...
none
1
1.024757
1
summary/summary_avail.py
bit0fun/plugins
173
9395
from datetime import datetime # ensure an rpc peer is added def addpeer(p, rpcpeer): pid = rpcpeer['id'] if pid not in p.persist['peerstate']: p.persist['peerstate'][pid] = { 'connected': rpcpeer['connected'], 'last_seen': datetime.now() if rpcpeer['connected'] else None, ...
from datetime import datetime # ensure an rpc peer is added def addpeer(p, rpcpeer): pid = rpcpeer['id'] if pid not in p.persist['peerstate']: p.persist['peerstate'][pid] = { 'connected': rpcpeer['connected'], 'last_seen': datetime.now() if rpcpeer['connected'] else None, ...
en
0.850368
# ensure an rpc peer is added # exponetially smooth online/offline states of peers
2.444984
2
terrascript/dns/r.py
hugovk/python-terrascript
4
9396
# terrascript/dns/r.py import terrascript class dns_a_record_set(terrascript.Resource): pass class dns_aaaa_record_set(terrascript.Resource): pass class dns_cname_record(terrascript.Resource): pass class dns_mx_record_set(terrascript.Resource): pass class dns_ns_record_set(terrascript.Resource...
# terrascript/dns/r.py import terrascript class dns_a_record_set(terrascript.Resource): pass class dns_aaaa_record_set(terrascript.Resource): pass class dns_cname_record(terrascript.Resource): pass class dns_mx_record_set(terrascript.Resource): pass class dns_ns_record_set(terrascript.Resource...
en
0.357026
# terrascript/dns/r.py
1.850092
2
JumpscaleCore/clients/tcprouter/TCPRouterFactory.py
gneumann333/jumpscaleX_core
1
9397
<filename>JumpscaleCore/clients/tcprouter/TCPRouterFactory.py<gh_stars>1-10 from Jumpscale import j from .TCPRouterClient import TCPRouterClient JSConfigs = j.baseclasses.object_config_collection class TCPRouterFactory(JSConfigs): __jslocation__ = "j.clients.tcp_router" _CHILDCLASS = TCPRouterClient de...
<filename>JumpscaleCore/clients/tcprouter/TCPRouterFactory.py<gh_stars>1-10 from Jumpscale import j from .TCPRouterClient import TCPRouterClient JSConfigs = j.baseclasses.object_config_collection class TCPRouterFactory(JSConfigs): __jslocation__ = "j.clients.tcp_router" _CHILDCLASS = TCPRouterClient de...
en
0.712469
kosmos 'j.clients.tcp_router.test()' # get a client instance (TO CHECK: secret is already assigned to backend) # connect to backend # stop connection
2.154353
2
nmrglue/fileio/spinsolve.py
miguelarbesu/nmrglue
0
9398
""" Functions for reading Magritek Spinsolve binary (dx/1d) files and parameter (acqu.par/proc.par) files. """ import os from warnings import warn import numpy as np from . import fileiobase from . import jcampdx __developer_info__ = """ Spinsolve is the software used on the Magritek benchtop NMR devices. A spect...
""" Functions for reading Magritek Spinsolve binary (dx/1d) files and parameter (acqu.par/proc.par) files. """ import os from warnings import warn import numpy as np from . import fileiobase from . import jcampdx __developer_info__ = """ Spinsolve is the software used on the Magritek benchtop NMR devices. A spect...
en
0.721382
Functions for reading Magritek Spinsolve binary (dx/1d) files and parameter (acqu.par/proc.par) files. Spinsolve is the software used on the Magritek benchtop NMR devices. A spectrum is saved in a folder with several files. The spectral data is stored in these files: 'data.1d' (FID), 'spectrum.1d' (Fourier transforme...
2.645175
3
src/navigation_analytics/navigation_data.py
mielgosez/navigation_analytics
0
9399
<reponame>mielgosez/navigation_analytics import logging import copy import pickle import pandas as pd class BaseClass: def __init__(self, input_data: pd.DataFrame, logger: logging.Logger, metadata: dict): self.__input_data = input_data self.__logg...
import logging import copy import pickle import pandas as pd class BaseClass: def __init__(self, input_data: pd.DataFrame, logger: logging.Logger, metadata: dict): self.__input_data = input_data self.__logger = logger self.__metadata = met...
en
0.796107
# Pipelines # Validation Rules Verifies that event identifier is primary key of input data. :return: Validation Verifies that groups matches with those declared in metadata. :return: Validation Verifies that there's at most one group per session. :return: Validation Filter session by group id pr...
2.425006
2