hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72f74e9499225c66ece09f508b8f7dac132b713 | 1,812 | py | Python | experiments/analysis/edge_bound/training_nlf/camera_nlf_training.py | haihabi/GenerativeCRB | d53c01bec7214bb087fbe17dba241e12eb60858e | [
"MIT"
] | null | null | null | experiments/analysis/edge_bound/training_nlf/camera_nlf_training.py | haihabi/GenerativeCRB | d53c01bec7214bb087fbe17dba241e12eb60858e | [
"MIT"
] | null | null | null | experiments/analysis/edge_bound/training_nlf/camera_nlf_training.py | haihabi/GenerativeCRB | d53c01bec7214bb087fbe17dba241e12eb60858e | [
"MIT"
] | null | null | null | import torch
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
from experiments.data_model.image_denoising.noise_dataset import NoiseDataSet
from experiments.models_architecture.camera_nlf_flow import generate_nlf_flow
def train_step(in_noise, in_cond_vector):
opt.zero_grad()
lo... | 34.846154 | 94 | 0.667219 | import torch
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
from experiments.data_model.image_denoising.noise_dataset import NoiseDataSet
from experiments.models_architecture.camera_nlf_flow import generate_nlf_flow
def train_step(in_noise, in_cond_vector):
opt.zero_grad()
lo... | true | true |
f72f75554d82d37ec9ea899454d23be4c88365df | 4,843 | py | Python | torch/distributed/elastic/metrics/__init__.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2021-04-11T08:27:46.000Z | 2021-04-11T08:27:46.000Z | torch/distributed/elastic/metrics/__init__.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2022-01-18T12:17:29.000Z | 2022-01-18T12:17:29.000Z | torch/distributed/elastic/metrics/__init__.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 2 | 2021-07-02T10:18:21.000Z | 2021-08-18T10:10:28.000Z | #!/usr/bin/env/python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""Metrics API
**Overview**:
The metrics API in torchelastic is used to publish telemet... | 29.530488 | 97 | 0.742308 |
from typing import Optional
from .api import ( ConsoleMetricHandler,
MetricData,
MetricHandler,
MetricsConfig,
NullMetricHandler,
configure,
get_elapsed_time_ms,
getStream,
prof,
profile,
publish_metric,
put_metric,
)
def initialize_metrics(cfg: Optional[MetricsCon... | true | true |
f72f76abe1221bf6bd92370f84f0906ef075e999 | 3,133 | py | Python | src/dataset_builder.py | elangovana/large-scale-ptm-ppi | cc835df915d12dd20c35f9cea5e40365200a6d3d | [
"MIT"
] | 1 | 2022-02-25T22:06:39.000Z | 2022-02-25T22:06:39.000Z | src/dataset_builder.py | elangovana/ppi-aimed | cc835df915d12dd20c35f9cea5e40365200a6d3d | [
"MIT"
] | null | null | null | src/dataset_builder.py | elangovana/ppi-aimed | cc835df915d12dd20c35f9cea5e40365200a6d3d | [
"MIT"
] | null | null | null | import logging
import os
from torch.utils.data import DataLoader
from locator import Locator
class DatasetBuilder:
def __init__(self, val_data, dataset_factory_name, tokenisor_factory_name, train_data=None, num_workers=None,
batch_size=8, addition_args_dict=None):
self._addition_args_d... | 34.811111 | 116 | 0.635812 | import logging
import os
from torch.utils.data import DataLoader
from locator import Locator
class DatasetBuilder:
def __init__(self, val_data, dataset_factory_name, tokenisor_factory_name, train_data=None, num_workers=None,
batch_size=8, addition_args_dict=None):
self._addition_args_d... | true | true |
f72f78af5664f6874058767edba4aca0c9a4cc9f | 2,687 | py | Python | app/recipe/tests/test_ingredient_api.py | samderlust/recipe-app-api | 44d63426fe2875bd57900203d9dccc14550f1f9d | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredient_api.py | samderlust/recipe-app-api | 44d63426fe2875bd57900203d9dccc14550f1f9d | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredient_api.py | samderlust/recipe-app-api | 44d63426fe2875bd57900203d9dccc14550f1f9d | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:ingredi... | 30.534091 | 74 | 0.676219 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:ingredi... | true | true |
f72f7970ff216f32d358651dab960a4f8b67cce2 | 5,358 | py | Python | migrations/versions/a725247ae9b2_initial_migration.py | np1e/whoami_backend | d91540885c81194489b4b9d0dc67acfe81a59688 | [
"MIT"
] | null | null | null | migrations/versions/a725247ae9b2_initial_migration.py | np1e/whoami_backend | d91540885c81194489b4b9d0dc67acfe81a59688 | [
"MIT"
] | null | null | null | migrations/versions/a725247ae9b2_initial_migration.py | np1e/whoami_backend | d91540885c81194489b4b9d0dc67acfe81a59688 | [
"MIT"
] | null | null | null | """initial migration
Revision ID: a725247ae9b2
Revises:
Create Date: 2021-04-08 08:45:24.584283
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a725247ae9b2'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ... | 39.985075 | 99 | 0.66424 | from alembic import op
import sqlalchemy as sa
revision = 'a725247ae9b2'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('collection',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('name', sa.String(length=30), nullable=False)... | true | true |
f72f7a106d50691196cea4aa0e76813201841350 | 2,499 | py | Python | ndscheduler/default_settings.py | SquisEat/ndscheduler | 14df862cdafca37f46009419b7627989978c5803 | [
"BSD-2-Clause"
] | null | null | null | ndscheduler/default_settings.py | SquisEat/ndscheduler | 14df862cdafca37f46009419b7627989978c5803 | [
"BSD-2-Clause"
] | null | null | null | ndscheduler/default_settings.py | SquisEat/ndscheduler | 14df862cdafca37f46009419b7627989978c5803 | [
"BSD-2-Clause"
] | null | null | null | """Default settings."""
import logging
import os
#
# Development mode or production mode
# If DEBUG is True, then auto-reload is enabled, i.e., when code is modified, server will be
# reloaded immediately
#
DEBUG = True
#
# Static Assets
#
# The web UI is a single page app. All javascripts/css files should be in ST... | 24.262136 | 98 | 0.735494 |
import logging
import os
DEBUG = True
STATIC_DIR_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'static')
TEMPLATE_DIR_PATH = STATIC_DIR_PATH
APP_INDEX_PAGE = 'index.html'
HTTP_PORT = 7777
HTTP_ADDRESS = '127.0.0.1'
TORNADO_MAX_WORKERS = 8
THREAD_POOL_SIZE = 4
JOB_MAX_INSTANCES = 3
JOB_COALESCE... | true | true |
f72f7a7cce9f58fe52ac8e93e43957260898eeda | 1,281 | py | Python | tests/test_utils/test_import_namespaces.py | rajshruti18/biolinkml | 451e71c9d3fd11aa3b08c6a713d9ab8b127ece77 | [
"CC0-1.0"
] | 25 | 2019-07-05T01:16:18.000Z | 2021-03-22T20:49:25.000Z | tests/test_utils/test_import_namespaces.py | rajshruti18/biolinkml | 451e71c9d3fd11aa3b08c6a713d9ab8b127ece77 | [
"CC0-1.0"
] | 299 | 2019-03-05T15:15:30.000Z | 2021-04-08T23:25:41.000Z | tests/test_utils/test_import_namespaces.py | rajshruti18/biolinkml | 451e71c9d3fd11aa3b08c6a713d9ab8b127ece77 | [
"CC0-1.0"
] | 19 | 2019-05-23T17:46:47.000Z | 2021-03-25T06:45:55.000Z | import unittest
from biolinkml.generators.shexgen import ShExGenerator
from tests.test_utils.environment import env
class URLImportTestCase(unittest.TestCase):
@unittest.skipIf(False, "Finish implementing this")
def test_import_from_url(self):
""" Validate namespace bindings """
shex = ShExG... | 24.169811 | 79 | 0.613583 | import unittest
from biolinkml.generators.shexgen import ShExGenerator
from tests.test_utils.environment import env
class URLImportTestCase(unittest.TestCase):
@unittest.skipIf(False, "Finish implementing this")
def test_import_from_url(self):
shex = ShExGenerator(env.input_path('import_test_l2.yaml... | true | true |
f72f7ae3ee8c69c4af98bcfa7cfeb00f3ed16fef | 82 | py | Python | demo/demoproject/demoapp/views.py | mrc75/django-easy-reports | 5a92e8e1fd199ee3fd0fdfd5b47d84fe72861a0a | [
"BSD-1-Clause"
] | 2 | 2015-05-28T10:35:54.000Z | 2016-11-18T04:33:26.000Z | demo/demoproject/demoapp/views.py | mrc75/django-easy-reports | 5a92e8e1fd199ee3fd0fdfd5b47d84fe72861a0a | [
"BSD-1-Clause"
] | 1 | 2015-10-25T01:50:04.000Z | 2015-10-25T01:50:04.000Z | demo/demoproject/demoapp/views.py | saxix/django-easy-reports | 81679b0c49d728c198601f7ee3a726a66cae49b5 | [
"BSD-1-Clause"
] | null | null | null | from ereports.views import ReportIndex
class ReportsView(ReportIndex):
pass
| 13.666667 | 38 | 0.792683 | from ereports.views import ReportIndex
class ReportsView(ReportIndex):
pass
| true | true |
f72f7b324f2181b534f98b9140d1f67ec53e65b6 | 597 | py | Python | mms/utils/__init__.py | abhinavs95/mxnet-model-server | 901c1a9a2def8373cd9a91c8d2f47248eed281cc | [
"Apache-2.0"
] | 1 | 2019-01-10T20:56:25.000Z | 2019-01-10T20:56:25.000Z | mms/utils/__init__.py | frankfliu/mxnet-model-server | ce36c9e35efc17efe0fb79bb7019bdf3593131a5 | [
"Apache-2.0"
] | null | null | null | mms/utils/__init__.py | frankfliu/mxnet-model-server | ce36c9e35efc17efe0fb79bb7019bdf3593131a5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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://www.apache.org/licenses/LICENSE-2.0
# or in the "license" file... | 42.642857 | 75 | 0.752094 | true | true | |
f72f7b9ba7292667009bfeeb0edba74ee8da34be | 74,707 | py | Python | lib/galaxy/webapps/galaxy/api/workflows.py | itisAliRH/galaxy | b3b693ea0788f773442c8481472a87f43ccb10d7 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/api/workflows.py | itisAliRH/galaxy | b3b693ea0788f773442c8481472a87f43ccb10d7 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/api/workflows.py | itisAliRH/galaxy | b3b693ea0788f773442c8481472a87f43ccb10d7 | [
"CC-BY-3.0"
] | null | null | null | """
API operations for Workflows
"""
import hashlib
import json
import logging
import os
from typing import (
Any,
Dict,
List,
Optional,
)
from fastapi import (
Body,
Path,
Query,
Response,
status,
)
from gxformat2._yaml import ordered_dump
from markupsafe import escape
from pydant... | 43.66277 | 204 | 0.625136 |
import hashlib
import json
import logging
import os
from typing import (
Any,
Dict,
List,
Optional,
)
from fastapi import (
Body,
Path,
Query,
Response,
status,
)
from gxformat2._yaml import ordered_dump
from markupsafe import escape
from pydantic import Extra
from galaxy import (... | true | true |
f72f7ca31617049ebeb428ce645c75a60f6eb63c | 22,243 | py | Python | setup.py | kylemannock/python-games | 1cd25fb4b52c2226dae2d77c996c878bad4bcd65 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | setup.py | kylemannock/python-games | 1cd25fb4b52c2226dae2d77c996c878bad4bcd65 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | setup.py | kylemannock/python-games | 1cd25fb4b52c2226dae2d77c996c878bad4bcd65 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | #!/usr/bin/env python
#
# This is the distutils setup script for pygame.
# Full instructions are in https://www.pygame.org/wiki/GettingStarted
#
# To configure, compile, install, just run this script.
# python setup.py install
DESCRIPTION = """Pygame is a Python wrapper module for the
SDL multimedia library. It co... | 32.61437 | 99 | 0.572944 |
DESCRIPTION = """Pygame is a Python wrapper module for the
SDL multimedia library. It contains python functions and classes
that will allow you to use SDL's support for playing cdroms,
audio and video output, and keyboard, mouse and joystick input."""
EXTRAS = {}
METADATA = {
"name": "pygame",
"v... | true | true |
f72f7d71973611e5b1b6ca5c103ced2746353d09 | 2,070 | py | Python | ansible/old/inventory.py | Otus-DevOps-2021-11/ivan32rus_infra | d504a0bf8d98c9850b005390cd93aeea7e81bd1e | [
"MIT"
] | null | null | null | ansible/old/inventory.py | Otus-DevOps-2021-11/ivan32rus_infra | d504a0bf8d98c9850b005390cd93aeea7e81bd1e | [
"MIT"
] | 9 | 2021-12-20T21:16:20.000Z | 2022-02-18T11:56:22.000Z | docker/docker-monolith/infra/ansible/inventory.py | Otus-DevOps-2021-11/ivan32rus_microservices | 88e273124d1e1b39c46c526370b96385779c5a05 | [
"MIT"
] | 1 | 2021-12-18T11:49:30.000Z | 2021-12-18T11:49:30.000Z | #!/usr/bin/env python
'''
Example custom dynamic inventory script for Ansible, in Python.
FOR pyhhon 3.8.10 it's working
used:
https://www.jeffgeerling.com/blog/creating-custom-dynamic-inventories-ansible
'''
import os
import sys
import argparse
try:
import json
except ImportError:
import simplejson as json... | 26.883117 | 77 | 0.528986 |
import os
import sys
import argparse
try:
import json
except ImportError:
import simplejson as json
class ExampleInventory(object):
def __init__(self):
self.inventory = {}
self.read_cli_args()
if self.args.list:
self.inventory = self.example_inventory()
... | true | true |
f72f7e10becbbc60d0c8669c8b5575f45e441968 | 4,353 | py | Python | pyrelational/models/mcdropout_model.py | RelationRx/pyrelational | 41ededeff84158bd88b76d39006764de3388c821 | [
"Apache-2.0"
] | 42 | 2022-02-09T16:36:37.000Z | 2022-03-25T00:25:34.000Z | pyrelational/models/mcdropout_model.py | RelationRx/pyrelational | 41ededeff84158bd88b76d39006764de3388c821 | [
"Apache-2.0"
] | 4 | 2022-03-22T13:22:38.000Z | 2022-03-25T16:14:40.000Z | pyrelational/models/mcdropout_model.py | RelationRx/pyrelational | 41ededeff84158bd88b76d39006764de3388c821 | [
"Apache-2.0"
] | 3 | 2022-02-15T17:50:30.000Z | 2022-03-10T18:14:16.000Z | import copy
import logging
from abc import ABC
from typing import Dict, Optional, Type, Union
import torch
from pytorch_lightning import LightningModule
from torch.nn.modules import Module
from torch.utils.data import DataLoader
from .generic_model import GenericModel
from .lightning_model import LightningModel
logg... | 32.977273 | 115 | 0.623938 | import copy
import logging
from abc import ABC
from typing import Dict, Optional, Type, Union
import torch
from pytorch_lightning import LightningModule
from torch.nn.modules import Module
from torch.utils.data import DataLoader
from .generic_model import GenericModel
from .lightning_model import LightningModel
logg... | true | true |
f72f7e5086ec62838452027d2f90f7f9292e8954 | 1,602 | py | Python | fairml/tests/test_orthogonal_projection.py | ravish0007/fairml | bdfb707ff9554c1a789dc8de3926c1ef3cfb1fc8 | [
"MIT"
] | 330 | 2017-02-24T08:34:39.000Z | 2022-02-24T15:41:19.000Z | fairml/tests/test_orthogonal_projection.py | ravish0007/fairml | bdfb707ff9554c1a789dc8de3926c1ef3cfb1fc8 | [
"MIT"
] | 14 | 2017-02-02T00:54:16.000Z | 2021-02-19T16:01:20.000Z | fairml/tests/test_orthogonal_projection.py | ravish0007/fairml | bdfb707ff9554c1a789dc8de3926c1ef3cfb1fc8 | [
"MIT"
] | 70 | 2017-01-31T20:51:10.000Z | 2022-02-17T07:38:52.000Z | from __future__ import division
import pytest
import numpy as np
from random import randint
from fairml.orthogonal_projection import audit_model
from fairml.orthogonal_projection import get_orthogonal_vector
from fairml.utils import mse
from fairml.utils import accuracy
from fairml.utils import detect_feature_sign
... | 25.428571 | 63 | 0.671036 | from __future__ import division
import pytest
import numpy as np
from random import randint
from fairml.orthogonal_projection import audit_model
from fairml.orthogonal_projection import get_orthogonal_vector
from fairml.utils import mse
from fairml.utils import accuracy
from fairml.utils import detect_feature_sign
... | true | true |
f72f8089cc89101fe7a243dfe2b57fdf92cb7ad2 | 22,912 | py | Python | LLDBagility/stubvm.py | killvxk/LLDBagility | 6cc0df91bd49e43997b77048611d1b73f43f7b29 | [
"Apache-2.0"
] | 1 | 2019-07-13T12:04:04.000Z | 2019-07-13T12:04:04.000Z | LLDBagility/stubvm.py | killvxk/LLDBagility | 6cc0df91bd49e43997b77048611d1b73f43f7b29 | [
"Apache-2.0"
] | null | null | null | LLDBagility/stubvm.py | killvxk/LLDBagility | 6cc0df91bd49e43997b77048611d1b73f43f7b29 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import re
import threading
import lldbagilityutils
from PyFDP.FDP import FDP
from VMSN import VMSN
logger = lldbagilityutils.create_indented_logger(__name__, "/tmp/stubvm.log")
NULL = 0x0
# https://github.com/apple/darwin-xnu/blob/xnu-4903.221.2/osfmk/i386/eflags.h
EF... | 37.255285 | 148 | 0.659043 | import re
import threading
import lldbagilityutils
from PyFDP.FDP import FDP
from VMSN import VMSN
logger = lldbagilityutils.create_indented_logger(__name__, "/tmp/stubvm.log")
NULL = 0x0
EFL_TF = 0x00000100
I386_PGBYTES = 4096
VM_MIN_KERNEL_ADDRESS = 0xFFFFFF8000000000
VM_MAX_KERNEL_ADDRESS = 0xFFFFFFFFFFFFEFFF
... | true | true |
f72f83101ec2c8b57466741fe18334c3e7fb24c9 | 3,882 | py | Python | dewars/zone6.py | drnasmith/flask-ispyb-logistics | 930b2707fc1d679607fc2d8d3d0895edfc944af6 | [
"Apache-2.0"
] | null | null | null | dewars/zone6.py | drnasmith/flask-ispyb-logistics | 930b2707fc1d679607fc2d8d3d0895edfc944af6 | [
"Apache-2.0"
] | null | null | null | dewars/zone6.py | drnasmith/flask-ispyb-logistics | 930b2707fc1d679607fc2d8d3d0895edfc944af6 | [
"Apache-2.0"
] | 1 | 2018-10-31T13:53:27.000Z | 2018-10-31T13:53:27.000Z | # System imports
from datetime import datetime
import time
import json
import logging
# Package imports
from flask import Blueprint
from flask import render_template
from flask import jsonify
from flask import request
# Local imports
import common
api = Blueprint('zone6', __name__, url_prefix='/zone6')
rack_prefix ... | 29.409091 | 118 | 0.516486 | from datetime import datetime
import time
import json
import logging
from flask import Blueprint
from flask import render_template
from flask import jsonify
from flask import request
import common
api = Blueprint('zone6', __name__, url_prefix='/zone6')
rack_prefix = 'RACK'
rack_suffixes = ['A1', 'A2', 'A3', 'A4',
... | true | true |
f72f834ad520c083812e4cfa1295c11679786a0f | 7,772 | py | Python | video2html.py | stevevai/video2chars | b90a2280d184083a746087d1c12d638afa3da5bb | [
"Apache-2.0"
] | 1 | 2019-04-14T16:28:25.000Z | 2019-04-14T16:28:25.000Z | video2html.py | stevevai/video2chars | b90a2280d184083a746087d1c12d638afa3da5bb | [
"Apache-2.0"
] | null | null | null | video2html.py | stevevai/video2chars | b90a2280d184083a746087d1c12d638afa3da5bb | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
import json
import os
import cv2
import numpy as np
from time import time
import webbrowser
play_chars_js = '''
let i = 0;
window.setInterval(function(){
let img = frames[i++];
let html = ""
for(let line of img){
for(let char of line){
let [[r,g,b], ch] = char;... | 28.15942 | 119 | 0.523289 | import json
import os
import cv2
import numpy as np
from time import time
import webbrowser
play_chars_js = '''
let i = 0;
window.setInterval(function(){
let img = frames[i++];
let html = ""
for(let line of img){
for(let char of line){
let [[r,g,b], ch] = char;
line += '<... | true | true |
f72f8513b66880f4db7e38933741e9e12297e8ac | 142 | py | Python | data_parse/get_banks_NY.py | hhalim/TargetBanks | 8febd7300f3b01e92641e0f63355d3f66bfe674c | [
"MIT"
] | null | null | null | data_parse/get_banks_NY.py | hhalim/TargetBanks | 8febd7300f3b01e92641e0f63355d3f66bfe674c | [
"MIT"
] | null | null | null | data_parse/get_banks_NY.py | hhalim/TargetBanks | 8febd7300f3b01e92641e0f63355d3f66bfe674c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from parse_banks import parse_and_insert
#STATE = TX
file = '../data/NY_SOD_FDIC.html'
parse_and_insert(file, 'NY')
| 17.75 | 40 | 0.697183 | from parse_banks import parse_and_insert
file = '../data/NY_SOD_FDIC.html'
parse_and_insert(file, 'NY')
| true | true |
f72f865c6f3e0b0d982fd0cd8b5149aa4a6ebc41 | 12,464 | py | Python | tools/gen_esp_err_to_name.py | jkoelker/esp-idf | 4b91c82cc447640e5b61407e810f1d6f3eabd233 | [
"Apache-2.0"
] | 2 | 2018-06-27T02:28:03.000Z | 2020-12-08T19:33:44.000Z | tools/gen_esp_err_to_name.py | jkoelker/esp-idf | 4b91c82cc447640e5b61407e810f1d6f3eabd233 | [
"Apache-2.0"
] | null | null | null | tools/gen_esp_err_to_name.py | jkoelker/esp-idf | 4b91c82cc447640e5b61407e810f1d6f3eabd233 | [
"Apache-2.0"
] | 1 | 2021-01-09T16:19:22.000Z | 2021-01-09T16:19:22.000Z | #!/usr/bin/env python
#
# Copyright 2018 Espressif Systems (Shanghai) PTE 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 req... | 39.948718 | 168 | 0.594352 |
import os
import argparse
import re
import fnmatch
import string
import collections
import textwrap
ignore_files = [ 'components/mdns/test_afl_fuzz_host/esp32_compat.h' ]
priority_headers = [ 'components/esp32/include/esp_err.h' ]
err_dict = collections.defaultdict(list) rev_err_dict = dict() unproc_list = list()
... | true | true |
f72f86c3063032f7831abf4c8121553aee852eaf | 5,154 | py | Python | ba5l-linear-space-alignment/lsa_v2.py | kjco/bioinformatics-algorithms | 3c466157b89c1cbd54749563e39d86a307d7a3f3 | [
"MIT"
] | null | null | null | ba5l-linear-space-alignment/lsa_v2.py | kjco/bioinformatics-algorithms | 3c466157b89c1cbd54749563e39d86a307d7a3f3 | [
"MIT"
] | null | null | null | ba5l-linear-space-alignment/lsa_v2.py | kjco/bioinformatics-algorithms | 3c466157b89c1cbd54749563e39d86a307d7a3f3 | [
"MIT"
] | null | null | null | import sys
import math
sys.setrecursionlimit(20)
# 0: down, 1: right, 2: lower right
SIGMA = 5
# Number of columns to keep in the score matrix
BUF_WIDTH = 2
def compute_scores(str1, str2, m, b):
"""Populates the score and backtrack matrices.
Args:
str1: first string.
str2: sec... | 26.56701 | 97 | 0.521925 | import sys
import math
sys.setrecursionlimit(20)
SIGMA = 5
BUF_WIDTH = 2
def compute_scores(str1, str2, m, b):
"""Populates the score and backtrack matrices.
Args:
str1: first string.
str2: second string.
m: score matrix.
b: backtrack matrix.
"""
last... | false | true |
f72f87aeb2af6ecbc535d203c78b35e72e451ee6 | 40,174 | py | Python | pandas/core/indexes/interval.py | mattboggess/pandas | 5551bcf9d297ea8a0aeffb70b17ae6730e8abf89 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/interval.py | mattboggess/pandas | 5551bcf9d297ea8a0aeffb70b17ae6730e8abf89 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/interval.py | mattboggess/pandas | 5551bcf9d297ea8a0aeffb70b17ae6730e8abf89 | [
"BSD-3-Clause"
] | 1 | 2018-10-14T18:27:49.000Z | 2018-10-14T18:27:49.000Z | """ define the IntervalIndex """
import textwrap
import warnings
import numpy as np
from pandas.compat import add_metaclass
from pandas.core.dtypes.missing import isna
from pandas.core.dtypes.cast import find_common_type, maybe_downcast_to_dtype
from pandas.core.dtypes.common import (
ensure_platform_int,
is_... | 34.543422 | 84 | 0.599218 | import textwrap
import warnings
import numpy as np
from pandas.compat import add_metaclass
from pandas.core.dtypes.missing import isna
from pandas.core.dtypes.cast import find_common_type, maybe_downcast_to_dtype
from pandas.core.dtypes.common import (
ensure_platform_int,
is_list_like,
is_datetime_or_tim... | true | true |
f72f87d18502022289e2800971f93cfb71acdce7 | 50 | py | Python | gateway/__init__.py | RockefellerArchiveCenter/ProjectElectronAPIGateway | 4a35c24fe5c09df4f849d1f74b45af5a49c61ac6 | [
"MIT"
] | null | null | null | gateway/__init__.py | RockefellerArchiveCenter/ProjectElectronAPIGateway | 4a35c24fe5c09df4f849d1f74b45af5a49c61ac6 | [
"MIT"
] | null | null | null | gateway/__init__.py | RockefellerArchiveCenter/ProjectElectronAPIGateway | 4a35c24fe5c09df4f849d1f74b45af5a49c61ac6 | [
"MIT"
] | null | null | null | default_app_config = 'gateway.apps.GatewayConfig'
| 25 | 49 | 0.84 | default_app_config = 'gateway.apps.GatewayConfig'
| true | true |
f72f8822d3d4ac66a54db0bfc296d706ac05a14c | 1,219 | py | Python | setup.py | duyyudus/iconviet-lottery | ade157e050a6dac468a300d37c0c67a1e92e5d30 | [
"MIT"
] | null | null | null | setup.py | duyyudus/iconviet-lottery | ade157e050a6dac468a300d37c0c67a1e92e5d30 | [
"MIT"
] | null | null | null | setup.py | duyyudus/iconviet-lottery | ade157e050a6dac468a300d37c0c67a1e92e5d30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
# All dependences
deps = {
'test': [],
'dev': ['iconsdk', 'tbears', 'pylint', 'autopep8', 'rope', 'black',],
}
install_requires = []
extra_requires = deps
test_requires = deps['test']
with open('README.adoc') as readme_file:
long_descrip... | 28.348837 | 73 | 0.660377 | from setuptools import setup, find_packages
deps = {
'test': [],
'dev': ['iconsdk', 'tbears', 'pylint', 'autopep8', 'rope', 'black',],
}
install_requires = []
extra_requires = deps
test_requires = deps['test']
with open('README.adoc') as readme_file:
long_description = readme_file.read()
setup(
name... | true | true |
f72f888a64c2817014cb56a0375b9b4d1a93dade | 749 | py | Python | try.py | charliezjw/Neural-Signal-Decoder | fb0df09ba0314724c7c90141bd47cc8fb0201b7a | [
"MIT"
] | null | null | null | try.py | charliezjw/Neural-Signal-Decoder | fb0df09ba0314724c7c90141bd47cc8fb0201b7a | [
"MIT"
] | null | null | null | try.py | charliezjw/Neural-Signal-Decoder | fb0df09ba0314724c7c90141bd47cc8fb0201b7a | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
# a = tf.placeholder(tf.int32, [None, 3])
#
# b = tf.convert_to_tensor(tf.argmax(tf.bincount(a[0])))
# b = tf.stack([b, tf.argmax(tf.bincount(a[1]))], 0)
# for i in range(2, 5):
# max_indx = tf.argmax(tf.bincount(a[i]))
# b = tf.concat([b, [max_indx]], 0)
#
# with tf.... | 31.208333 | 83 | 0.542056 | import numpy as np
import tensorflow as tf
a = np.asarray(np.asarray([[1, 1, 0], [2, 4, 4], [6, 6, 6], [5, 5, 5], [2, 7, 7]]))
b = np.zeros(a.shape[0])
c = np.asarray([1, 4, 6, 7, 9])
for i in range(a.shape[0]):
b[i] = np.argmax(np.bincount(a[i]))
print(np.mean(np.equal(b, c))) | true | true |
f72f896b8a657f3551e24d80c0f44854acb5a54c | 666 | py | Python | pipeline/compilers/livescript.py | jnis77diver/django-pipeline | 8bac57adae84615d9d79ad19b2b591c2e46879f9 | [
"MIT"
] | 1 | 2019-10-20T02:58:27.000Z | 2019-10-20T02:58:27.000Z | pipeline/compilers/livescript.py | jnis77diver/django-pipeline | 8bac57adae84615d9d79ad19b2b591c2e46879f9 | [
"MIT"
] | 1 | 2021-09-20T22:02:21.000Z | 2021-09-21T13:55:41.000Z | pipeline/compilers/livescript.py | jnis77diver/django-pipeline | 8bac57adae84615d9d79ad19b2b591c2e46879f9 | [
"MIT"
] | 1 | 2021-09-18T01:39:48.000Z | 2021-09-18T01:39:48.000Z | from __future__ import unicode_literals
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
class LiveScriptCompiler(SubProcessCompiler):
output_extension = 'js'
def match_file(self, path):
return path.endswith('.ls')
def compile_file(self, infile, outfile, outd... | 28.956522 | 73 | 0.672673 | from __future__ import unicode_literals
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
class LiveScriptCompiler(SubProcessCompiler):
output_extension = 'js'
def match_file(self, path):
return path.endswith('.ls')
def compile_file(self, infile, outfile, outd... | true | true |
f72f8af5b3ccf2010b8feadf774b09fd508c9661 | 32,775 | py | Python | WhoopClient.py | lcintron/WhoopClient | 46ccc6c3e3b98f4b6c82cf8938056d72a22bd6b6 | [
"MIT"
] | null | null | null | WhoopClient.py | lcintron/WhoopClient | 46ccc6c3e3b98f4b6c82cf8938056d72a22bd6b6 | [
"MIT"
] | null | null | null | WhoopClient.py | lcintron/WhoopClient | 46ccc6c3e3b98f4b6c82cf8938056d72a22bd6b6 | [
"MIT"
] | null | null | null | import requests
import pandas as pd
import numpy as np
import configparser
from datetime import datetime
from dateutil import relativedelta, parser, rrule
from dateutil.rrule import WEEKLY
class WhoopClient:
'''A class to allow a user to login and store their authorization code,
then perform pulls using t... | 43.993289 | 121 | 0.49251 | import requests
import pandas as pd
import numpy as np
import configparser
from datetime import datetime
from dateutil import relativedelta, parser, rrule
from dateutil.rrule import WEEKLY
class WhoopClient:
def __init__(self,
auth_code=None,
whoop_id=None,
curre... | true | true |
f72f8c8616ebfc02596b74d7d800b811e4d3bb3f | 18,406 | py | Python | third_party/texar-0.2.0/examples/bert/utils/data_utils.py | swidi/poemo-generation | 3a349ac3a6fc3e82b24410013bced60a24c2d8bf | [
"MIT"
] | null | null | null | third_party/texar-0.2.0/examples/bert/utils/data_utils.py | swidi/poemo-generation | 3a349ac3a6fc3e82b24410013bced60a24c2d8bf | [
"MIT"
] | null | null | null | third_party/texar-0.2.0/examples/bert/utils/data_utils.py | swidi/poemo-generation | 3a349ac3a6fc3e82b24410013bced60a24c2d8bf | [
"MIT"
] | null | null | null | """
This is the Data Loading Pipeline for Sentence Classifier Task from
https://github.com/google-research/bert/blob/master/run_classifier.py
"""
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in... | 38.10766 | 80 | 0.60703 |
import os
import csv
import collections
import sys
sys.path.append(os.path.dirname(__file__))
import tokenization
import tensorflow as tf
class InputExample():
def __init__(self, guid, text_a, text_b=None, label=None):
self.guid = guid
self.text_a = text_a
self.text_b = text_b
sel... | true | true |
f72f8d11340df1f1d9eb56840c1b60800b76a5a8 | 827 | py | Python | Calculator.py | EdvinAlvarado/Code-Wars | a3a06a44cda004052b5c0930f3693678c5c92e21 | [
"BSD-2-Clause"
] | null | null | null | Calculator.py | EdvinAlvarado/Code-Wars | a3a06a44cda004052b5c0930f3693678c5c92e21 | [
"BSD-2-Clause"
] | null | null | null | Calculator.py | EdvinAlvarado/Code-Wars | a3a06a44cda004052b5c0930f3693678c5c92e21 | [
"BSD-2-Clause"
] | null | null | null |
class Calculator(object):
def evaluate(self, string):
print(string)
cmd = [int(s) if s.isdigit() else s for s in string.split(" ")]
cmd = [float(s) if isinstance(s, str) and s.find('.') != -1 else s for s in cmd]
print(cmd)
for i in range(sum([1 if s == '*' or s == '/' else 0 for s in cmd])):
for i... | 22.972222 | 82 | 0.481258 |
class Calculator(object):
def evaluate(self, string):
print(string)
cmd = [int(s) if s.isdigit() else s for s in string.split(" ")]
cmd = [float(s) if isinstance(s, str) and s.find('.') != -1 else s for s in cmd]
print(cmd)
for i in range(sum([1 if s == '*' or s == '/' else 0 for s in cmd])):
for i... | true | true |
f72f8d12e338c378aeef5bdcbc21e4ce4e2a2aa1 | 7,335 | py | Python | src/vmware/azext_vmware/_help.py | sanmishra18/azure-cli-extensions | 05499b7931a1fe4cd4536a6b83fa4f8f13663996 | [
"MIT"
] | 1 | 2021-04-22T09:20:58.000Z | 2021-04-22T09:20:58.000Z | src/vmware/azext_vmware/_help.py | sanmishra18/azure-cli-extensions | 05499b7931a1fe4cd4536a6b83fa4f8f13663996 | [
"MIT"
] | 1 | 2020-07-30T06:44:01.000Z | 2020-07-30T06:44:01.000Z | src/vmware/azext_vmware/_help.py | Juliehzl/azure-cli-extensions | b0b33f4d45c2e4c50ece782851291d967e1f36e2 | [
"MIT"
] | 1 | 2020-11-09T17:17:42.000Z | 2020-11-09T17:17:42.000Z | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------... | 34.763033 | 204 | 0.671438 |
from knack.help_files import helps
helps['vmware'] = """
type: group
short-summary: Commands to manage Azure VMware Solution.
"""
helps['vmware private-cloud'] = """
type: group
short-summary: Commands to manage private clouds.
"""
helps['vmware cluster'] = """
type: group
s... | true | true |
f72f8d9198afb6938ccdaa898c7765d5213e95ab | 1,699 | py | Python | docs/source/example_models.py | 2degrees/djeneralize | ef456292397888bd0476786d9f4ab2854b3604ef | [
"BSD-3-Clause"
] | 4 | 2015-10-19T10:49:47.000Z | 2017-03-22T13:06:32.000Z | docs/source/example_models.py | 2degrees/djeneralize | ef456292397888bd0476786d9f4ab2854b3604ef | [
"BSD-3-Clause"
] | 1 | 2015-04-16T17:37:15.000Z | 2015-04-17T08:05:21.000Z | docs/source/example_models.py | 2degrees/djeneralize | ef456292397888bd0476786d9f4ab2854b3604ef | [
"BSD-3-Clause"
] | 3 | 2015-08-12T12:28:03.000Z | 2015-09-30T09:45:40.000Z | from django.db import models
from djeneralize.models import BaseGeneralizationModel
from djeneralize.fields import SpecializedForeignKey
#{ General model
class WritingImplement(BaseGeneralizationModel):
name = models.CharField(max_length=30)
length = models.IntegerField()
holder = SpecializedForeignKe... | 18.877778 | 75 | 0.727487 | from django.db import models
from djeneralize.models import BaseGeneralizationModel
from djeneralize.fields import SpecializedForeignKey
class WritingImplement(BaseGeneralizationModel):
name = models.CharField(max_length=30)
length = models.IntegerField()
holder = SpecializedForeignKey(
'Writi... | true | true |
f72f8e30417092439e50e50b97f2efb35888640b | 2,204 | py | Python | laikaboss/modules/explode_re_sub.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | 2 | 2019-11-02T23:40:23.000Z | 2019-12-01T22:24:57.000Z | laikaboss/modules/explode_re_sub.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | null | null | null | laikaboss/modules/explode_re_sub.py | sandialabs/laikaboss | 3064ac1176911651d61c5176e9bd83eacec36b16 | [
"Apache-2.0"
] | 3 | 2017-08-09T23:58:40.000Z | 2019-12-01T22:25:06.000Z | # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 36.733333 | 126 | 0.696915 | import re
import binascii
from laikaboss.si_module import SI_MODULE
from laikaboss.objectmodel import ModuleObject, ExternalVars
import laikaboss.util
class EXPLODE_RE_SUB(SI_MODULE):
def __init__(self,):
self.module_name = "EXPLODE_RE_SUB"
self.re_pattern = None
def _run(self, scanObject, re... | true | true |
f72f8e94a0df815f7d517e2b81ffc86c5c545f07 | 2,893 | py | Python | tensorflow/contrib/autograph/utils/multiple_dispatch_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/autograph/utils/multiple_dispatch_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/autograph/utils/multiple_dispatch_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 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... | 38.065789 | 80 | 0.733495 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.autograph.utils import multiple_dispatch
from tensorflow.python.client.session import Session
from tensorflow.python.framework.constant_op import constant
from tenso... | true | true |
f72f8f3096b8b8f70f02fbf592b95d3864e87c01 | 594 | py | Python | papy/misc.py | ArcturusB/papy | 360e4cc6b5c8473f8a5e8bce3153931f1a54a558 | [
"MIT"
] | 3 | 2022-03-10T08:13:07.000Z | 2022-03-10T08:13:13.000Z | papy/misc.py | ArcturusB/papy | 360e4cc6b5c8473f8a5e8bce3153931f1a54a558 | [
"MIT"
] | null | null | null | papy/misc.py | ArcturusB/papy | 360e4cc6b5c8473f8a5e8bce3153931f1a54a558 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import functools
import time
class Chrono():
def __init__(self, msg=None):
if msg:
print(msg)
self.t0 = time.time()
self.t = self.t0
def lap(self, name=None):
now = time.time()
if name:
print(name, end=': ')
msg = '... | 24.75 | 74 | 0.552189 |
import functools
import time
class Chrono():
def __init__(self, msg=None):
if msg:
print(msg)
self.t0 = time.time()
self.t = self.t0
def lap(self, name=None):
now = time.time()
if name:
print(name, end=': ')
msg = '{:.2g} s (total: {:.2g}... | true | true |
f72f90fd5e586ab49bbf8330d152dd3b15c6712f | 2,341 | py | Python | app/lib/models.py | simonlevine/x-transformer-icd | 17d0a84f8b8e1f69623a82c0afab26830c7a1eb8 | [
"BSD-3-Clause"
] | 1 | 2020-12-15T00:55:25.000Z | 2020-12-15T00:55:25.000Z | app/lib/models.py | simonlevine/x-transformer-icd | 17d0a84f8b8e1f69623a82c0afab26830c7a1eb8 | [
"BSD-3-Clause"
] | null | null | null | app/lib/models.py | simonlevine/x-transformer-icd | 17d0a84f8b8e1f69623a82c0afab26830c7a1eb8 | [
"BSD-3-Clause"
] | null | null | null | """deserialize auto-icd models and provide a consistent interface"""
import typing as t
import json
import pickle
from pathlib import Path
import numpy as np
import onnxruntime as rt
APP_ROOT = Path("./app")
ASSETS_DIR = APP_ROOT/"assets"
class AutoICDModel:
def __init__(self, onnx_model_fp):
assert on... | 34.940299 | 85 | 0.656557 |
import typing as t
import json
import pickle
from pathlib import Path
import numpy as np
import onnxruntime as rt
APP_ROOT = Path("./app")
ASSETS_DIR = APP_ROOT/"assets"
class AutoICDModel:
def __init__(self, onnx_model_fp):
assert onnx_model_fp.exists()
self.sess = rt.InferenceSession(str(onnx... | true | true |
f72f9151e8655b5897d9a3dbddc1abcb2e46e0c6 | 1,689 | py | Python | app.py | Catlinman/catlinman.com | 9a94b8491975cf589b9cd53262a54fa56b7a0555 | [
"MIT"
] | 2 | 2017-07-04T11:51:30.000Z | 2019-10-07T08:04:12.000Z | app.py | Catlinman/catlinman.com | 9a94b8491975cf589b9cd53262a54fa56b7a0555 | [
"MIT"
] | null | null | null | app.py | Catlinman/catlinman.com | 9a94b8491975cf589b9cd53262a54fa56b7a0555 | [
"MIT"
] | 2 | 2020-09-29T06:56:07.000Z | 2020-10-02T21:49:31.000Z |
# Import Python modules.
import sys
# Import application modules.
import assets
import database
import blueprints
# Import basic Sanic modules.
from sanic import Sanic
# Get the required Jinja2 module for rendering templates.
import jinja2 as j2
# Enabling async template execution which allows you to take advantag... | 25.590909 | 79 | 0.748372 |
import sys
import assets
import database
import blueprints
from sanic import Sanic
import jinja2 as j2
enable_async = sys.version_info >= (3, 6)
app = Sanic(name="catlinman.com", register=False)
app.static("/static", "./static")
template_env = j2.Environment(
loader=j2.PackageLoader("app", "templates"),
... | true | true |
f72f91b9b9f83a577df103957548819b165bf8d5 | 16,826 | py | Python | pychron/hardware/core/communicators/serial_communicator.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | null | null | null | pychron/hardware/core/communicators/serial_communicator.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/hardware/core/communicators/serial_communicator.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... | 31.927894 | 103 | 0.524664 |
import codecs
import glob
import os
import sys
import time
import serial
from .communicator import Communicator, process_response, prep_str, remove_eol_func
def get_ports():
if sys.platform == 'win32':
ports = ['COM{}'.format(i+1) for i in range(256)]
else:
usb = glob.glob('/dev/tty.usb*')... | true | true |
f72f91d02075c3865e71042a4c4631a5ce5c09f9 | 6,749 | py | Python | lfs/manage/views/marketing/featured.py | michael-hahn/django-lfs | 26c3471a8f8d88269c84f714f507b952dfdb6397 | [
"BSD-3-Clause"
] | 345 | 2015-01-03T19:19:27.000Z | 2022-03-20T11:00:50.000Z | lfs/manage/views/marketing/featured.py | michael-hahn/django-lfs | 26c3471a8f8d88269c84f714f507b952dfdb6397 | [
"BSD-3-Clause"
] | 73 | 2015-01-06T14:54:02.000Z | 2022-03-11T23:11:34.000Z | lfs/manage/views/marketing/featured.py | michael-hahn/django-lfs | 26c3471a8f8d88269c84f714f507b952dfdb6397 | [
"BSD-3-Clause"
] | 148 | 2015-01-07T16:30:08.000Z | 2022-03-25T21:20:58.000Z | import json
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils.translation import... | 33.577114 | 108 | 0.645281 | import json
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils.translation import... | true | true |
f72f92bc7ae99fd0568a2619f8d80e2d1390372f | 2,592 | py | Python | update.py | CyberHive/bucket-antivirus-function | bb5f91678cc85d08bfc42108edc399be5c5fc4b6 | [
"Apache-2.0"
] | null | null | null | update.py | CyberHive/bucket-antivirus-function | bb5f91678cc85d08bfc42108edc399be5c5fc4b6 | [
"Apache-2.0"
] | null | null | null | update.py | CyberHive/bucket-antivirus-function | bb5f91678cc85d08bfc42108edc399be5c5fc4b6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Upside Travel, 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... | 39.272727 | 87 | 0.717978 |
import os
import boto3
import clamav
from common import AV_DEFINITION_PATH
from common import AV_DEFINITION_S3_BUCKET
from common import AV_DEFINITION_S3_PREFIX
from common import CLAMAVLIB_PATH
from common import get_timestamp
import shutil
def lambda_handler(event, context):
s3_client = boto3.client("s3"... | true | true |
f72f92c99cf839ad598a33d59f04bbdac9db7a62 | 867 | py | Python | src/tensra/nn.py | poghostick/tensra | d171fd7483b3a61e36e133c95abfb78a9395297d | [
"MIT"
] | null | null | null | src/tensra/nn.py | poghostick/tensra | d171fd7483b3a61e36e133c95abfb78a9395297d | [
"MIT"
] | null | null | null | src/tensra/nn.py | poghostick/tensra | d171fd7483b3a61e36e133c95abfb78a9395297d | [
"MIT"
] | null | null | null | """
A NeuralNet is just a collection of layers.
It behaves a lot like a layer itself, although
we're not going to make it one.
"""
from typing import Sequence, Iterator, Tuple
from .tensor import Tensor
from .layers import Layer
class NeuralNet:
def __init__(self, layers: Sequence[Layer]) -> None:
self.l... | 27.967742 | 66 | 0.635525 | from typing import Sequence, Iterator, Tuple
from .tensor import Tensor
from .layers import Layer
class NeuralNet:
def __init__(self, layers: Sequence[Layer]) -> None:
self.layers = layers
def forward(self, inputs: Tensor) -> Tensor:
for layer in self.layers:
inputs = layer.forwa... | true | true |
f72f93203fa30524663dd1ad94aabbba9deee380 | 5,466 | py | Python | talos/templates/models.py | bjtho08/talos | dbd27b46a019f6fbfb7b7f08b2eb0de3be0a41ad | [
"MIT"
] | 1 | 2020-11-08T03:12:22.000Z | 2020-11-08T03:12:22.000Z | talos/templates/models.py | bjtho08/talos | dbd27b46a019f6fbfb7b7f08b2eb0de3be0a41ad | [
"MIT"
] | null | null | null | talos/templates/models.py | bjtho08/talos | dbd27b46a019f6fbfb7b7f08b2eb0de3be0a41ad | [
"MIT"
] | null | null | null | def breast_cancer(x_train, y_train, x_val, y_val, params):
from keras.models import Sequential
from keras.layers import Dropout, Dense
from talos.model import lr_normalizer, early_stopper, hidden_layers
from talos.metrics.keras_metrics import matthews, precision, recall, f1score
model = Sequentia... | 35.72549 | 80 | 0.551409 | def breast_cancer(x_train, y_train, x_val, y_val, params):
from keras.models import Sequential
from keras.layers import Dropout, Dense
from talos.model import lr_normalizer, early_stopper, hidden_layers
from talos.metrics.keras_metrics import matthews, precision, recall, f1score
model = Sequentia... | true | true |
f72f940275710e56f5500dcf7f4aacb8959a82b9 | 2,593 | py | Python | tensorflow_probability/python/bijectors/sigmoid_test.py | matthieucoquet/probability | 2426f4fc4743ceedc1a638a03d19ce6654ebff76 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/sigmoid_test.py | matthieucoquet/probability | 2426f4fc4743ceedc1a638a03d19ce6654ebff76 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/sigmoid_test.py | matthieucoquet/probability | 2426f4fc4743ceedc1a638a03d19ce6654ebff76 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... | 37.042857 | 115 | 0.69302 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import special
import tensorflow.compat.v2 as tf
from tensorflow_probability.python import bijectors as tfb
from tensorflow_probability.python.bijectors import bijector_test_util... | true | true |
f72f9494e109e2041d0b65a04cdffcdfc754e555 | 127 | py | Python | pysparkrpc/server/__init__.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | 1 | 2020-07-31T17:50:50.000Z | 2020-07-31T17:50:50.000Z | pysparkrpc/server/__init__.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | 3 | 2021-06-06T18:25:43.000Z | 2021-06-07T00:26:44.000Z | pysparkrpc/server/__init__.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | null | null | null | from pysparkrpc.server.server import run
from pysparkrpc.server.capture import Capture
__all__ = [
'run', 'Capture'
]
| 18.142857 | 45 | 0.724409 | from pysparkrpc.server.server import run
from pysparkrpc.server.capture import Capture
__all__ = [
'run', 'Capture'
]
| true | true |
f72f94e64373f2e4a2564243a8a3d17883885b79 | 2,599 | py | Python | tests/test_unit/test_ga4gh/test_testbed/test_report/test_summary.py | alextsaihi/ga4gh-testbed-lib | ad1cb6ea2bac85ae81ce75dfbbb74ef3f9dc1252 | [
"Apache-2.0"
] | null | null | null | tests/test_unit/test_ga4gh/test_testbed/test_report/test_summary.py | alextsaihi/ga4gh-testbed-lib | ad1cb6ea2bac85ae81ce75dfbbb74ef3f9dc1252 | [
"Apache-2.0"
] | 3 | 2022-03-21T18:30:27.000Z | 2022-03-30T18:04:05.000Z | tests/test_unit/test_ga4gh/test_testbed/test_report/test_summary.py | alextsaihi/ga4gh-testbed-lib | ad1cb6ea2bac85ae81ce75dfbbb74ef3f9dc1252 | [
"Apache-2.0"
] | null | null | null | import pytest
from ga4gh.testbed.report.summary import Summary
increment_inputs = "count_type," \
+ "use_n," \
+ "n,"
increment_cases = [
("unknown", False, 1),
("unknown", True, 3),
("passed", False, 1),
("passed", True, 4),
("warned", False, 1),
("warned", True, 5),
("failed", Fal... | 28.877778 | 76 | 0.652943 | import pytest
from ga4gh.testbed.report.summary import Summary
increment_inputs = "count_type," \
+ "use_n," \
+ "n,"
increment_cases = [
("unknown", False, 1),
("unknown", True, 3),
("passed", False, 1),
("passed", True, 4),
("warned", False, 1),
("warned", True, 5),
("failed", Fal... | true | true |
f72f950331335ccf80a3f395f9946878cbb3df84 | 1,153 | py | Python | plotfunction.py | kayaei/pands-problem-set | a7c48059e3024955794c67d9e6f969a42f4e3a6d | [
"Apache-2.0"
] | null | null | null | plotfunction.py | kayaei/pands-problem-set | a7c48059e3024955794c67d9e6f969a42f4e3a6d | [
"Apache-2.0"
] | null | null | null | plotfunction.py | kayaei/pands-problem-set | a7c48059e3024955794c67d9e6f969a42f4e3a6d | [
"Apache-2.0"
] | null | null | null | # Etem Kaya 16-Mar-2019
# Solution to Problem-10.
# File name: "plotfunction.py".
# Problem-10: Write a program that displays a plot of the functions x, x2 & 2x
# in the range [0, 4].
#Import matplotlib and numpy packages
import matplotlib.pyplot as plt
import numpy as np
# setup the lenght and scale of the x axis... | 25.622222 | 78 | 0.656548 |
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.0, 4.0, 0.5)
y1 = x y2 = x**2 y3 = 2**x
plt.plot(x, y1)
plt.plot(x, y2)
plt.plot(x, y3)
plt.plot(1, 1, 'or')
plt.plot(2, 4, 'bo')
plt.title('Plotting Graph for functions f(x), f(x^2) and f(2^x)')
plt.xlabel('X - Axis')
plt.ylab... | true | true |
f72f95655316cae4f59823e2c006bc6e12d8d83d | 6,245 | py | Python | ID09/run_wofry_polychromatic_partial_coherence.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | 1 | 2019-10-30T10:06:15.000Z | 2019-10-30T10:06:15.000Z | ID09/run_wofry_polychromatic_partial_coherence.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null | ID09/run_wofry_polychromatic_partial_coherence.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null |
#
# Import section
#
import numpy
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates
from wofry.propagator.propagator import PropagationManager, PropagationElements, PropagationParameters
from wofry.propagator.wavefront1D.generic_wavefront ... | 32.696335 | 120 | 0.689512 |
import numpy
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates
from wofry.propagator.propagator import PropagationManager, PropagationElements, PropagationParameters
from wofry.propagator.wavefront1D.generic_wavefront import GenericWavefro... | true | true |
f72f95ac268fc32ff366dbf8047445bc5328d793 | 3,775 | py | Python | myblog_project/settings.py | KevinPercy/myprofilerestapi | 88738997eec99982ca6774de2ffb5daaa640c26c | [
"MIT"
] | null | null | null | myblog_project/settings.py | KevinPercy/myprofilerestapi | 88738997eec99982ca6774de2ffb5daaa640c26c | [
"MIT"
] | 6 | 2021-03-19T07:57:21.000Z | 2021-09-22T19:14:19.000Z | myblog_project/settings.py | KevinPercy/myprofilerestapi | 88738997eec99982ca6774de2ffb5daaa640c26c | [
"MIT"
] | null | null | null | """
Django settings for myblog_project project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
impor... | 25.33557 | 91 | 0.692715 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'n$b=m%w%ynh82g66$o67=+t&a1n&r19%aggblv#f0nxw&2i_%e'
DEBUG = bool(int(os.environ.get('DEBUG', 1)))
# DEBUG = True
ALLOWED_HOSTS = [
'ec2-3-22-55-28.us-east-2.compute.amazonaws.com',
'3.22.55.28',
'api.kevinc... | true | true |
f72f97f7bd6a90c32e6a928e7162e7ae0f2fb559 | 2,394 | py | Python | toascii/CLI.py | Sh-wayz/to-ascii | b54bd9f68c7449982fbef6a0dad7e41e8d2d136e | [
"MIT"
] | 1 | 2020-10-20T19:09:27.000Z | 2020-10-20T19:09:27.000Z | toascii/CLI.py | Sh-wayz/to-ascii | b54bd9f68c7449982fbef6a0dad7e41e8d2d136e | [
"MIT"
] | null | null | null | toascii/CLI.py | Sh-wayz/to-ascii | b54bd9f68c7449982fbef6a0dad7e41e8d2d136e | [
"MIT"
] | null | null | null |
def main():
import argparse
from .Image import Image
from .Video import Video
from .Live import Live
parser = argparse.ArgumentParser(
prog='to-ascii',
description='A tool which can convert videos, images, gifs, and even live video to ascii art!'
)
# cli args
parser.a... | 38.612903 | 161 | 0.631161 |
def main():
import argparse
from .Image import Image
from .Video import Video
from .Live import Live
parser = argparse.ArgumentParser(
prog='to-ascii',
description='A tool which can convert videos, images, gifs, and even live video to ascii art!'
)
parser.add_argument... | true | true |
f72f99ed631de8235fb5965c7d3a5d3202831bf1 | 1,133 | py | Python | mongotopy.py | LaudateCorpus1/mongotopy | 50d51caa3928ce51dca2f77793a316c7e5049769 | [
"MIT"
] | null | null | null | mongotopy.py | LaudateCorpus1/mongotopy | 50d51caa3928ce51dca2f77793a316c7e5049769 | [
"MIT"
] | null | null | null | mongotopy.py | LaudateCorpus1/mongotopy | 50d51caa3928ce51dca2f77793a316c7e5049769 | [
"MIT"
] | 1 | 2022-01-29T07:48:26.000Z | 2022-01-29T07:48:26.000Z | #! /usr/bin/env python3
import os
import subprocess
import json
import sys
import time
seconds = '60'
prefix = "/var/tmp"
filename = "mongotopy.json"
def reformat(data):
formatted = []
data = data['totals']
for dbcoll in data:
database, coll = dbcoll.split(".",1)
for op in ["read", "write... | 27.634146 | 151 | 0.606355 |
import os
import subprocess
import json
import sys
import time
seconds = '60'
prefix = "/var/tmp"
filename = "mongotopy.json"
def reformat(data):
formatted = []
data = data['totals']
for dbcoll in data:
database, coll = dbcoll.split(".",1)
for op in ["read", "write"]:
for fiel... | true | true |
f72f9b9c8047300fbbc175a3ab3dd4814d1b1ad2 | 588 | py | Python | spam_v1/spam_last.py | Alpha-Demon404/RE-14 | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 39 | 2020-02-26T09:44:36.000Z | 2022-03-23T00:18:25.000Z | spam_v1/spam_last.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 15 | 2020-05-14T10:07:26.000Z | 2022-01-06T02:55:32.000Z | spam_v1/spam_last.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 41 | 2020-03-16T22:36:38.000Z | 2022-03-17T14:47:19.000Z | import base64
print(base64.b64decode('KoQKiESIgQWZk5WZTBSbhB3UigCI05WayBHIgAiC0hXZ05SKpkSK5kTO5kTO5kDLwgCdulGZuFmcu02bk5WYyhic0N3KuF2clBHLv5GK0FWby9mZuISf71TZnF2czVWbm03e94GZzl2ctZSdrFWbyFmZ9IXZk5WZzZSOxkTM1tWYtJXYmBHdv1DZ3BnJ1tWYtJXYmBHdvlGch1jclNXd/AHaw5yctN3Lt92YuUmb5RWYu5Cc09WLpBXYv8iOwRHdoJCK0V2ZuMHdzVWdxVmcgACIKo... | 196 | 573 | 0.972789 | import base64
print(base64.b64decode('KoQKiESIgQWZk5WZTBSbhB3UigCI05WayBHIgAiC0hXZ05SKpkSK5kTO5kTO5kDLwgCdulGZuFmcu02bk5WYyhic0N3KuF2clBHLv5GK0FWby9mZuISf71TZnF2czVWbm03e94GZzl2ctZSdrFWbyFmZ9IXZk5WZzZSOxkTM1tWYtJXYmBHdv1DZ3BnJ1tWYtJXYmBHdvlGch1jclNXd/AHaw5yctN3Lt92YuUmb5RWYu5Cc09WLpBXYv8iOwRHdoJCK0V2ZuMHdzVWdxVmcgACIKo... | true | true |
f72f9baea74b1b509ef292d0c804f4d84afcdecf | 1,633 | py | Python | tests/test_utils_cfdi_amounts.py | joules457/cfdi-iva-snippet | e8a8c2a1acae43ee763906bb88514ca181dc4294 | [
"MIT"
] | null | null | null | tests/test_utils_cfdi_amounts.py | joules457/cfdi-iva-snippet | e8a8c2a1acae43ee763906bb88514ca181dc4294 | [
"MIT"
] | null | null | null | tests/test_utils_cfdi_amounts.py | joules457/cfdi-iva-snippet | e8a8c2a1acae43ee763906bb88514ca181dc4294 | [
"MIT"
] | null | null | null | """
Test cfdi/utils/cfdi_amounts
"""
import os
import pytest
from tests.resources import scenarios
from cfdi.utils import cfdi_amounts as cfdia
@pytest.fixture(scope='session')
def dir_path():
return os.path.dirname(
os.path.realpath(__file__)
)
def test_get_directory_cfdi_amounts(dir_path):
fo... | 34.020833 | 68 | 0.621555 | import os
import pytest
from tests.resources import scenarios
from cfdi.utils import cfdi_amounts as cfdia
@pytest.fixture(scope='session')
def dir_path():
return os.path.dirname(
os.path.realpath(__file__)
)
def test_get_directory_cfdi_amounts(dir_path):
for scenario in scenarios.CFDI_AMOUNTS:
... | true | true |
f72f9ceda3ef7eb7bbb0856f097daa4acc3c96a8 | 2,564 | py | Python | openverse_api/test/image_integration_test.py | MuhammadFaizanHaidar/openverse_api | 65a624f4ad8389ce2b41bf210248f0d7a9ef2f28 | [
"MIT"
] | null | null | null | openverse_api/test/image_integration_test.py | MuhammadFaizanHaidar/openverse_api | 65a624f4ad8389ce2b41bf210248f0d7a9ef2f28 | [
"MIT"
] | null | null | null | openverse_api/test/image_integration_test.py | MuhammadFaizanHaidar/openverse_api | 65a624f4ad8389ce2b41bf210248f0d7a9ef2f28 | [
"MIT"
] | 1 | 2021-11-02T17:58:29.000Z | 2021-11-02T17:58:29.000Z | """
End-to-end API tests for images. Can be used to verify a live deployment is
functioning as designed. Run with the `pytest -s` command from this directory.
"""
import json
import xml.etree.ElementTree as ET
from test.constants import API_URL
from test.media_integration import (
detail,
report,
search,
... | 25.137255 | 88 | 0.693058 |
import json
import xml.etree.ElementTree as ET
from test.constants import API_URL
from test.media_integration import (
detail,
report,
search,
search_consistency,
search_quotes,
search_special_chars,
stats,
thumb,
)
from urllib.parse import urlencode
import pytest
import requests
@py... | true | true |
f72f9ee2b24540a19798faddf50ec1865ed092d8 | 22,235 | py | Python | DolfinPDESolver.py | WilliamPJSmith/CM4-A | bf2a0f2a49ea7e77454bacba25e6cbb2f282572f | [
"Unlicense"
] | null | null | null | DolfinPDESolver.py | WilliamPJSmith/CM4-A | bf2a0f2a49ea7e77454bacba25e6cbb2f282572f | [
"Unlicense"
] | null | null | null | DolfinPDESolver.py | WilliamPJSmith/CM4-A | bf2a0f2a49ea7e77454bacba25e6cbb2f282572f | [
"Unlicense"
] | null | null | null | """
DolfinPDESolver.py
==================
A python class structure written to interface CellModeller4 with the FEniCs/Dolfin finite element library.
Intended application: hybrid modelling of a microbial biofilm.
- Update: parameter input streamlined. New moving boundary mesh type.
- Update: added in-built test func... | 32.650514 | 119 | 0.671104 | """
DolfinPDESolver.py
==================
A python class structure written to interface CellModeller4 with the FEniCs/Dolfin finite element library.
Intended application: hybrid modelling of a microbial biofilm.
- Update: parameter input streamlined. New moving boundary mesh type.
- Update: added in-built test func... | false | true |
f72fa0af1e6f927dec3c1c91f5deebd3c63f8593 | 10,076 | py | Python | python/tests/test_metadata.py | brianzhang01/tskit | e4d80810e19034cffa77bb14bc0b8d77537103ad | [
"MIT"
] | null | null | null | python/tests/test_metadata.py | brianzhang01/tskit | e4d80810e19034cffa77bb14bc0b8d77537103ad | [
"MIT"
] | null | null | null | python/tests/test_metadata.py | brianzhang01/tskit | e4d80810e19034cffa77bb14bc0b8d77537103ad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018-2019 Tskit Developers
# Copyright (c) 2017 University of Oxford
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrict... | 38.166667 | 89 | 0.609071 | import io
import json
import os
import tempfile
import unittest
import pickle
import numpy as np
import python_jsonschema_objects as pjs
import msprime
import tskit
class TestMetadataHdf5RoundTrip(unittest.TestCase):
def setUp(self):
fd, self.temp_file = tempfile.mkstemp(prefix="msp_hdf5meta_test_")
... | true | true |
f72fa0e8e5609366cc6f530508b8be45c3bde4a6 | 410 | py | Python | student-work/quinn_zepeda/exercism/python/difference-of-squares/difference_of_squares.py | developerQuinnZ/this_will_work | 5587a9fd030b47f9df6514e45c887b6872d2a4a1 | [
"MIT"
] | null | null | null | student-work/quinn_zepeda/exercism/python/difference-of-squares/difference_of_squares.py | developerQuinnZ/this_will_work | 5587a9fd030b47f9df6514e45c887b6872d2a4a1 | [
"MIT"
] | null | null | null | student-work/quinn_zepeda/exercism/python/difference-of-squares/difference_of_squares.py | developerQuinnZ/this_will_work | 5587a9fd030b47f9df6514e45c887b6872d2a4a1 | [
"MIT"
] | null | null | null | def square_of_sum(number):
count = 0
for i in range(1,number + 1):
count += i
c_squared = count**2
return c_squared
def sum_of_squares(number):
total = 0
for i in range(1,number + 1):
total = total + (i**2)
return total
def difference(number):
first = square_of_sum(num... | 20.5 | 35 | 0.617073 | def square_of_sum(number):
count = 0
for i in range(1,number + 1):
count += i
c_squared = count**2
return c_squared
def sum_of_squares(number):
total = 0
for i in range(1,number + 1):
total = total + (i**2)
return total
def difference(number):
first = square_of_sum(num... | true | true |
f72fa13b43a3421e3c2d1f7f4c41c033295dd9e3 | 385 | py | Python | tino/server.py | NotSoSmartDev/Tino | fd3a941cc1efe07cd9eff209a9e3735a8f7dd537 | [
"MIT"
] | 143 | 2020-06-10T06:07:26.000Z | 2022-03-02T10:09:16.000Z | tino/server.py | NotSoSmartDev/Tino | fd3a941cc1efe07cd9eff209a9e3735a8f7dd537 | [
"MIT"
] | 1 | 2020-06-12T21:52:57.000Z | 2020-06-12T21:52:57.000Z | tino/server.py | NotSoSmartDev/Tino | fd3a941cc1efe07cd9eff209a9e3735a8f7dd537 | [
"MIT"
] | 6 | 2020-06-11T19:21:52.000Z | 2021-12-21T08:33:27.000Z | import uvicorn
class Server(uvicorn.Server):
async def startup(self, sockets=None):
await super().startup(sockets=sockets)
for f in self.config.loaded_app.startup_funcs:
await f()
async def shutdown(self, sockets=None):
await super().shutdown(sockets=sockets)
for f... | 27.5 | 55 | 0.654545 | import uvicorn
class Server(uvicorn.Server):
async def startup(self, sockets=None):
await super().startup(sockets=sockets)
for f in self.config.loaded_app.startup_funcs:
await f()
async def shutdown(self, sockets=None):
await super().shutdown(sockets=sockets)
for f... | true | true |
f72fa17a88f924a7ba488b256d1381abe02cf435 | 381 | py | Python | src/vertex.py | lavish205/graph-db | 523cfd50ccb6fdc2644f595e3a76dd71e760bbb4 | [
"MIT"
] | 1 | 2020-09-05T03:07:35.000Z | 2020-09-05T03:07:35.000Z | src/vertex.py | lavish205/graph-db | 523cfd50ccb6fdc2644f595e3a76dd71e760bbb4 | [
"MIT"
] | null | null | null | src/vertex.py | lavish205/graph-db | 523cfd50ccb6fdc2644f595e3a76dd71e760bbb4 | [
"MIT"
] | null | null | null | from utils import Compression
class Vertex(object):
def __init__(self, identifier, ctype):
self.id = identifier
self.type = ctype
def compress(self):
return Compression.compress(self)
@staticmethod
def decompress(val):
return Compression.decompress(val)
def __repr... | 21.166667 | 49 | 0.643045 | from utils import Compression
class Vertex(object):
def __init__(self, identifier, ctype):
self.id = identifier
self.type = ctype
def compress(self):
return Compression.compress(self)
@staticmethod
def decompress(val):
return Compression.decompress(val)
def __repr... | true | true |
f72fa21904e69b4faea9e41fe537a9887bcd643e | 2,662 | py | Python | python/array.py | mr-uuid/snippets | 49bb59641d8160d7635b8d5e574cb50f9e5362e2 | [
"MIT"
] | null | null | null | python/array.py | mr-uuid/snippets | 49bb59641d8160d7635b8d5e574cb50f9e5362e2 | [
"MIT"
] | 1 | 2021-03-10T04:00:01.000Z | 2021-03-10T04:00:01.000Z | python/array.py | mr-uuid/snippets | 49bb59641d8160d7635b8d5e574cb50f9e5362e2 | [
"MIT"
] | null | null | null | import unittest
class Tester(unittest.TestCase):
def test_zip(self):
"""
zip takes to arrays and makes an array of tuples where tuple 1 is a
tuple composed of element 1 of array 1 and 2, etc...
"""
# combines to arrays into one array of tuples
self.assertEqual(
... | 30.25 | 79 | 0.472953 | import unittest
class Tester(unittest.TestCase):
def test_zip(self):
self.assertEqual(
zip(sorted(set('qwerty')), sorted(set('asdfgh'))),
[('e', 'a'), ('q', 'd'), ('r', 'f'),
('t', 'g'), ('w', 'h'), ('y', 's')]
)
questions = ['name', 'quest', ... | true | true |
f72fa31aa61c2010032ba331da9c46f0c28c8f64 | 586 | py | Python | recipys/types.py | gmso/recipys | 8ca39a7b0ace2c678fe7a5c8271c6843db6c2c35 | [
"MIT"
] | 13 | 2021-07-24T20:49:35.000Z | 2021-08-21T18:15:16.000Z | recipys/types.py | gmso/recipys | 8ca39a7b0ace2c678fe7a5c8271c6843db6c2c35 | [
"MIT"
] | 2 | 2021-08-17T17:11:09.000Z | 2021-09-01T19:05:17.000Z | recipys/types.py | gmso/recipys | 8ca39a7b0ace2c678fe7a5c8271c6843db6c2c35 | [
"MIT"
] | 1 | 2021-07-29T16:36:35.000Z | 2021-07-29T16:36:35.000Z | from dataclasses import dataclass
from typing import Optional, List
@dataclass
class RecipeConstraints:
meal: Optional[str] = None
ingredients: Optional[List[str]] = None
@dataclass
class Printable:
title: str = ""
ingredients: str = ""
preparation: str = ""
error_message: Opt... | 20.206897 | 44 | 0.677474 | from dataclasses import dataclass
from typing import Optional, List
@dataclass
class RecipeConstraints:
meal: Optional[str] = None
ingredients: Optional[List[str]] = None
@dataclass
class Printable:
title: str = ""
ingredients: str = ""
preparation: str = ""
error_message: Opt... | true | true |
f72fa471e47a678d1cdcba520ccfb797969a10c8 | 43 | py | Python | src/brython_jinja2/__init__.py | jonathanverner/brython-jinja2 | cec6e16de1750203a858d0acf590f230fc3bf848 | [
"BSD-3-Clause"
] | 2 | 2020-09-13T17:51:55.000Z | 2020-11-25T18:47:12.000Z | src/brython_jinja2/__init__.py | jonathanverner/brython-jinja2 | cec6e16de1750203a858d0acf590f230fc3bf848 | [
"BSD-3-Clause"
] | 2 | 2020-11-25T19:18:15.000Z | 2021-06-01T21:48:12.000Z | src/brython_jinja2/__init__.py | jonathanverner/brython-jinja2 | cec6e16de1750203a858d0acf590f230fc3bf848 | [
"BSD-3-Clause"
] | null | null | null | from . import platform
from . import utils
| 14.333333 | 22 | 0.767442 | from . import platform
from . import utils
| true | true |
f72fa4cf65c6c8ffeabe5891fa79f70b7f2fe473 | 8,228 | py | Python | app/worker/tasks/importers/historical_data_importer.py | CodeTheChangeUBC/reBOOT | df6a7d9990fc261c28bf65b83b561a765dc78723 | [
"MIT"
] | 10 | 2017-10-17T04:35:44.000Z | 2021-03-19T21:12:15.000Z | app/worker/tasks/importers/historical_data_importer.py | CodeTheChangeUBC/reBOOT | df6a7d9990fc261c28bf65b83b561a765dc78723 | [
"MIT"
] | 224 | 2017-10-18T18:33:48.000Z | 2022-02-02T03:33:04.000Z | app/worker/tasks/importers/historical_data_importer.py | CodeTheChangeUBC/reBOOT | df6a7d9990fc261c28bf65b83b561a765dc78723 | [
"MIT"
] | 1 | 2018-08-02T03:10:25.000Z | 2018-08-02T03:10:25.000Z | import re
from dateutil.parser import parse
from django.utils import timezone as tz
from .base_csv_importer import BaseCsvImporter
from app.constants.item_map import ITEM_MAP
from app.enums import ItemStatusEnum
from app.models import Donor, Donation, Item, ItemDevice, ItemDeviceType
class HistoricalDataImporter(Bas... | 34.426778 | 79 | 0.565386 | import re
from dateutil.parser import parse
from django.utils import timezone as tz
from .base_csv_importer import BaseCsvImporter
from app.constants.item_map import ITEM_MAP
from app.enums import ItemStatusEnum
from app.models import Donor, Donation, Item, ItemDevice, ItemDeviceType
class HistoricalDataImporter(Bas... | true | true |
f72fa56028b7563a6c7ecc30355b5545eb740df6 | 16,939 | py | Python | arxiv_public_data/authors.py | The-Collaboratory/arxiv-public-datasets | a3578b2a693c964ed8310d8ddc3a3801f33ce3c9 | [
"MIT"
] | null | null | null | arxiv_public_data/authors.py | The-Collaboratory/arxiv-public-datasets | a3578b2a693c964ed8310d8ddc3a3801f33ce3c9 | [
"MIT"
] | null | null | null | arxiv_public_data/authors.py | The-Collaboratory/arxiv-public-datasets | a3578b2a693c964ed8310d8ddc3a3801f33ce3c9 | [
"MIT"
] | null | null | null | # https://github.com/arXiv/arxiv-base@32e6ad0
"""
Copyright 2017 Cornell University
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
... | 36.040426 | 179 | 0.611724 |
import re
import os
import gzip
import json
from itertools import dropwhile
from typing import Dict, Iterator, List, Tuple
from multiprocessing import Pool, cpu_count
PREFIX_MATCH = 'van|der|de|la|von|del|della|da|mac|ter|dem|di|vaziri'
def parse_author_affil(authors: str) -> List[List[str]]:
return _parse_a... | true | true |
f72fa578f87bc853943bee3e503ed704b0ffd3fc | 32,916 | py | Python | plugin/lighthouse/composer/shell.py | chubbymaggie/lighthouse | e6c494a0c8dd2aca09b71b981e8c0c03d9078cdd | [
"MIT"
] | 1 | 2017-10-27T23:02:29.000Z | 2017-10-27T23:02:29.000Z | plugin/lighthouse/composer/shell.py | yrp604/lighthouse | b92a25906fb2513d8bfc4454c41e6378984d9ad9 | [
"MIT"
] | null | null | null | plugin/lighthouse/composer/shell.py | yrp604/lighthouse | b92a25906fb2513d8bfc4454c41e6378984d9ad9 | [
"MIT"
] | null | null | null | from .parser import *
from lighthouse.util import *
#------------------------------------------------------------------------------
# Composing Shell
#------------------------------------------------------------------------------
class ComposingShell(QtWidgets.QWidget):
"""
The ComposingShell UI for interacti... | 32.981964 | 105 | 0.571363 | from .parser import *
from lighthouse.util import *
class ComposingShell(QtWidgets.QWidget):
def __init__(self, director, model, table=None):
super(ComposingShell, self).__init__()
self.setObjectName(self.__class__.__name__)
self._director = director
self._palette = direc... | true | true |
f72fa5c26a43311b6bb327f0a6c60d08da6bf7f5 | 122 | py | Python | jobbing/models_remote/__init__.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | null | null | null | jobbing/models_remote/__init__.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | null | null | null | jobbing/models_remote/__init__.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# flake8: noqa
from __future__ import absolute_import
from jobbing.models_remote.zip_code import ZipCode | 20.333333 | 50 | 0.819672 |
from __future__ import absolute_import
from jobbing.models_remote.zip_code import ZipCode | true | true |
f72fa5d84e135d78f70840c368783f3034e3d49b | 2,946 | py | Python | payment_lib_examples/alipay-sdk-python/virtual_environment/lib/python3.4/site-packages/alipay/aop/api/domain/AOIinfo.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | null | null | null | payment_lib_examples/alipay-sdk-python/virtual_environment/lib/python3.4/site-packages/alipay/aop/api/domain/AOIinfo.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | null | null | null | payment_lib_examples/alipay-sdk-python/virtual_environment/lib/python3.4/site-packages/alipay/aop/api/domain/AOIinfo.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AOIinfo(object):
def __init__(self):
self._adcode = None
self._area = None
self._distance = None
self._id = None
self._location = None
self._name =... | 25.396552 | 67 | 0.5241 | import json
from alipay.aop.api.constant.ParamConstants import *
class AOIinfo(object):
def __init__(self):
self._adcode = None
self._area = None
self._distance = None
self._id = None
self._location = None
self._name = None
@property
def adcode(self):
... | true | true |
f72fa5dd5997ddce41d5321eaba142024cd484ab | 21,887 | py | Python | setup.py | pexip/os-mod-wsgi | 969aee194275c599dd769c645c080dceeea5639e | [
"Apache-2.0"
] | 1 | 2019-04-22T16:49:34.000Z | 2019-04-22T16:49:34.000Z | setup.py | pexip/os-mod-wsgi | 969aee194275c599dd769c645c080dceeea5639e | [
"Apache-2.0"
] | null | null | null | setup.py | pexip/os-mod-wsgi | 969aee194275c599dd769c645c080dceeea5639e | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import sys
import fnmatch
import subprocess
import tarfile
import shutil
import stat
import re
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
from setuptools import setup
from distutils.core import Extension
from ... | 36.971284 | 160 | 0.670489 | from __future__ import print_function
import os
import sys
import fnmatch
import subprocess
import tarfile
import shutil
import stat
import re
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
from setuptools import setup
from distutils.core import Extension
from ... | true | true |
f72fa655c2b497532a44793ccd4680c179b00048 | 4,942 | py | Python | zhiliao/filebrowsersafe/fields.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | zhiliao/filebrowsersafe/fields.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | zhiliao/filebrowsersafe/fields.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from future.builtins import str
from future.builtins import super
# coding: utf-8
# imports
import os
import datetime
# django imports
from django.db import models
from django import forms
from django.core.files.storage import default_storage
from django.forms.widgets import In... | 35.3 | 138 | 0.653784 | from __future__ import unicode_literals
from future.builtins import str
from future.builtins import super
import os
import datetime
from django.db import models
from django import forms
from django.core.files.storage import default_storage
from django.forms.widgets import Input
from django.db.models.fields import Fie... | true | true |
f72fa985b72bc3ee85306c46c1ed7734c3a40686 | 2,607 | py | Python | bahamutexporter/core/service.py | Yooootsuba/bahamut-exporter | 1fcf95f7eca86709ece1ed1d2704c540731682d5 | [
"MIT"
] | 2 | 2022-01-10T06:53:11.000Z | 2022-01-10T07:41:51.000Z | bahamutexporter/core/service.py | Yooootsuba/bahamut-exporter | 1fcf95f7eca86709ece1ed1d2704c540731682d5 | [
"MIT"
] | null | null | null | bahamutexporter/core/service.py | Yooootsuba/bahamut-exporter | 1fcf95f7eca86709ece1ed1d2704c540731682d5 | [
"MIT"
] | null | null | null | import re
import html
import json
import requests
from bs4 import BeautifulSoup
class BamahutExporterService:
def __init__(self):
self.session = requests.Session()
self.session.headers.update({'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.5... | 35.22973 | 159 | 0.513617 | import re
import html
import json
import requests
from bs4 import BeautifulSoup
class BamahutExporterService:
def __init__(self):
self.session = requests.Session()
self.session.headers.update({'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.5... | true | true |
f72faa1d19c3225e9a6701fb72dfb2c626ceba53 | 3,099 | py | Python | airflow/dags/udac_example_dag.py | aliiae/data-engineering | 96ee73a52de9504fc7e9eda748c90e0966c4fa03 | [
"MIT"
] | null | null | null | airflow/dags/udac_example_dag.py | aliiae/data-engineering | 96ee73a52de9504fc7e9eda748c90e0966c4fa03 | [
"MIT"
] | null | null | null | airflow/dags/udac_example_dag.py | aliiae/data-engineering | 96ee73a52de9504fc7e9eda748c90e0966c4fa03 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators import (
StageToRedshiftOperator,
LoadFactOperator,
LoadDimensionOperator,
DataQualityOperator,
)
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.postgres_operator import PostgresOp... | 28.431193 | 75 | 0.757018 | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators import (
StageToRedshiftOperator,
LoadFactOperator,
LoadDimensionOperator,
DataQualityOperator,
)
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.postgres_operator import PostgresOp... | true | true |
f72faaed66845c4f79aa0c5322e4ebcb367d7bcc | 766 | py | Python | Misc/d3_heatmap.py | mahnooranjum/Python_Programming | ba251e0e855842112efeb968d06458c60eaf1bd3 | [
"MIT"
] | null | null | null | Misc/d3_heatmap.py | mahnooranjum/Python_Programming | ba251e0e855842112efeb968d06458c60eaf1bd3 | [
"MIT"
] | null | null | null | Misc/d3_heatmap.py | mahnooranjum/Python_Programming | ba251e0e855842112efeb968d06458c60eaf1bd3 | [
"MIT"
] | null | null | null | '''
Mahnoor Anjum
Python:
Trivariate Analysis
'''
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import math
import random
from mpl_toolkits.mplot3d import Axes3D
# sns.set()
path = 'data/private/savepath/'
filename = 'v3_1'
genpath = 'data/private/gen/'
... | 18.238095 | 45 | 0.66188 | import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import math
import random
from mpl_toolkits.mplot3d import Axes3D
path = 'data/private/savepath/'
filename = 'v3_1'
genpath = 'data/private/gen/'
genname = 'g3_1'
data = pd.read_csv(path + filename+'.csv')
gen = pd.read_csv... | true | true |
f72fab45a2f4c772cc4437cfc0c167040cf1b405 | 1,591 | py | Python | processout/invoicerisk.py | processout/processout-python | f8311702fe2d392817dcb66347a7a13b9cd91e92 | [
"MIT"
] | 1 | 2017-02-22T10:57:10.000Z | 2017-02-22T10:57:10.000Z | processout/invoicerisk.py | processout/processout-python | f8311702fe2d392817dcb66347a7a13b9cd91e92 | [
"MIT"
] | 1 | 2018-12-14T14:30:57.000Z | 2018-12-14T14:30:57.000Z | processout/invoicerisk.py | processout/processout-python | f8311702fe2d392817dcb66347a7a13b9cd91e92 | [
"MIT"
] | 2 | 2018-12-13T23:08:11.000Z | 2018-12-30T19:52:31.000Z | try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
import processout
import json
from processout.networking.request import Request
from processout.networking.response import Response
# The content of this file was automatically generated
class InvoiceRisk(object):
... | 23.057971 | 71 | 0.588938 | try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
import processout
import json
from processout.networking.request import Request
from processout.networking.response import Response
class InvoiceRisk(object):
def __init__(self, client, prefill = None):
s... | true | true |
f72fac17ae338185f2e1470376f1a6802595e44a | 1,514 | py | Python | jnpy/app/vnpy_webtrader/__init__.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | 5 | 2020-05-19T07:32:39.000Z | 2022-03-14T09:09:48.000Z | jnpy/app/vnpy_webtrader/__init__.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | null | null | null | jnpy/app/vnpy_webtrader/__init__.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | 3 | 2020-04-02T08:30:17.000Z | 2020-05-03T12:12:05.000Z | # The MIT License (MIT)
#
# Copyright (c) 2015-present, Xiaoyou Chen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | 37.85 | 81 | 0.738441 |
from pathlib import Path
from vnpy.trader.app import BaseApp
from .engine import WebEngine, APP_NAME
class WebTraderApp(BaseApp):
app_name = APP_NAME
app_module = __module__
app_path = Path(__file__).parent
display_name = "Web服务"
engine_class = WebEngine
widget_name = "WebMa... | true | true |
f72facb0930186c23043da299ca86f58450425a0 | 3,448 | py | Python | src/plugins/radeky_bot/utils/bilibiliuploader/bilibiliuploader.py | Radekyspec/Radeky_bot | 24ee088026c7443723a5e9c72abfb512ca3b3327 | [
"MIT"
] | 4 | 2021-12-25T10:17:13.000Z | 2022-03-03T03:29:07.000Z | src/plugins/radeky_bot/utils/bilibiliuploader/bilibiliuploader.py | Radekyspec/Radeky_bot | 24ee088026c7443723a5e9c72abfb512ca3b3327 | [
"MIT"
] | null | null | null | src/plugins/radeky_bot/utils/bilibiliuploader/bilibiliuploader.py | Radekyspec/Radeky_bot | 24ee088026c7443723a5e9c72abfb512ca3b3327 | [
"MIT"
] | 1 | 2021-12-25T10:17:16.000Z | 2021-12-25T10:17:16.000Z | from . import core
from .util import cipher
from nonebot import logger
import json
class BilibiliUploader():
def __init__(self):
self.access_token = None
self.refresh_token = None
self.sid = None
self.mid = None
def login(self, username, password):
code, self.access_to... | 28.733333 | 107 | 0.476798 | from . import core
from .util import cipher
from nonebot import logger
import json
class BilibiliUploader():
def __init__(self):
self.access_token = None
self.refresh_token = None
self.sid = None
self.mid = None
def login(self, username, password):
code, self.access_to... | true | true |
f72fad071798fd320fcd248a5514555dad9f2802 | 1,006 | py | Python | netvisor_api_client/requests/product.py | ajmyyra/netvisor-api-client | b12f90606b8f66580873a1ff16737fa614aee5ef | [
"MIT"
] | null | null | null | netvisor_api_client/requests/product.py | ajmyyra/netvisor-api-client | b12f90606b8f66580873a1ff16737fa614aee5ef | [
"MIT"
] | null | null | null | netvisor_api_client/requests/product.py | ajmyyra/netvisor-api-client | b12f90606b8f66580873a1ff16737fa614aee5ef | [
"MIT"
] | null | null | null | """
netvisor.requests.product
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2013-2016 by Fast Monkeys Oy | 2019- by Heltti Oy
:license: MIT, see LICENSE for more details.
"""
from .base import Request
from ..exc import InvalidData
from ..responses.products import GetProductResponse, ProductListResponse
c... | 27.189189 | 73 | 0.621272 | from .base import Request
from ..exc import InvalidData
from ..responses.products import GetProductResponse, ProductListResponse
class GetProductRequest(Request):
method = 'GET'
uri = 'GetProduct.nv'
response_cls = GetProductResponse
def parse_response(self, response):
data = super(GetProduct... | true | true |
f72fad7595d798f28e7a2ab25421f74e4783d2ed | 4,409 | py | Python | tests/experimental/test_util.py | claytonlemons/python-pachyderm | 6e7f4c5c66486233390f4ba3f05a2056f1e21e9f | [
"Apache-2.0"
] | null | null | null | tests/experimental/test_util.py | claytonlemons/python-pachyderm | 6e7f4c5c66486233390f4ba3f05a2056f1e21e9f | [
"Apache-2.0"
] | null | null | null | tests/experimental/test_util.py | claytonlemons/python-pachyderm | 6e7f4c5c66486233390f4ba3f05a2056f1e21e9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests of utility functions."""
import os
import json
import tempfile
import python_pachyderm
from python_pachyderm.experimental.service import pps_proto
from tests import util
# bp_to_pb: PfsInput -> PFSInput
# script that copies a file using just stdlibs
TEST_STDLIB_SOURCE = """
from shut... | 29.198675 | 97 | 0.635972 |
import os
import json
import tempfile
import python_pachyderm
from python_pachyderm.experimental.service import pps_proto
from tests import util
TEST_STDLIB_SOURCE = """
from shutil import copyfile
print("copying")
copyfile("/pfs/{}/file.dat", "/pfs/out/file.dat")
"""
TEST_LIB_SOURCE = """
from termcolor import c... | true | true |
f72fad937cc7df0f5730a5937036f84b9f33c80d | 1,322 | py | Python | src/evaluator.py | ryoutoku/real-coded-genetic-algorithm | 4d0c72527e497e57e18c56d43e8c217a388ca86f | [
"MIT"
] | 2 | 2019-05-14T02:04:02.000Z | 2020-04-02T00:19:01.000Z | src/evaluator.py | ryoutoku/real-coded-genetic-algorithm | 4d0c72527e497e57e18c56d43e8c217a388ca86f | [
"MIT"
] | null | null | null | src/evaluator.py | ryoutoku/real-coded-genetic-algorithm | 4d0c72527e497e57e18c56d43e8c217a388ca86f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
import math
from individual import Individual
class Evaluator(metaclass=ABCMeta):
def __init__(self):
Individual.set_evaluator(self)
def evaluate(self, individual):
"""個体を評価する
Args:
individual (individual):... | 20.338462 | 73 | 0.53177 | from abc import ABCMeta, abstractmethod
import math
from individual import Individual
class Evaluator(metaclass=ABCMeta):
def __init__(self):
Individual.set_evaluator(self)
def evaluate(self, individual):
return self._evaluate_function(individual.gene)
@abstractmethod
def _evaluate... | true | true |
f72fae73b6d958f9d94b097c0f0e32534effcad9 | 21,412 | py | Python | cogs/leveling.py | DevRohit06/Abode | 5864cdf3c74d51bea325d123e075a1becc541c91 | [
"MIT"
] | 15 | 2020-12-28T12:07:09.000Z | 2021-08-21T15:35:53.000Z | cogs/leveling.py | DevRohit06/Abode | 5864cdf3c74d51bea325d123e075a1becc541c91 | [
"MIT"
] | null | null | null | cogs/leveling.py | DevRohit06/Abode | 5864cdf3c74d51bea325d123e075a1becc541c91 | [
"MIT"
] | 8 | 2020-12-29T04:24:12.000Z | 2021-04-04T23:29:13.000Z | import discord
from discord.ext import commands, tasks
import datetime
import random
from prettytable import PrettyTable
import random
from random import randint
data = ['Water', 'Air', 'Earth', 'Fire', 'Destruction',
'Illusion', 'Time', 'Space', 'Karma', 'Chaos']
paths = random.choice(data)
luck = random.r... | 42.066798 | 240 | 0.500841 | import discord
from discord.ext import commands, tasks
import datetime
import random
from prettytable import PrettyTable
import random
from random import randint
data = ['Water', 'Air', 'Earth', 'Fire', 'Destruction',
'Illusion', 'Time', 'Space', 'Karma', 'Chaos']
paths = random.choice(data)
luck = random.r... | true | true |
f72fb037fc55f7ca2cf905ff81db0de58b739c7f | 363 | py | Python | trips-backend/tours/migrations/0003_auto_20210312_1921.py | pgarr/best-trips | edc45f6e822b70aa9bfa6f9d4ee8b2c58df54310 | [
"MIT"
] | null | null | null | trips-backend/tours/migrations/0003_auto_20210312_1921.py | pgarr/best-trips | edc45f6e822b70aa9bfa6f9d4ee8b2c58df54310 | [
"MIT"
] | null | null | null | trips-backend/tours/migrations/0003_auto_20210312_1921.py | pgarr/best-trips | edc45f6e822b70aa9bfa6f9d4ee8b2c58df54310 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-12 18:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tours', '0002_auto_20210308_2016'),
]
operations = [
migrations.RenameField(
model_name='reservation',
old_name='user',
... | 19.105263 | 47 | 0.584022 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tours', '0002_auto_20210308_2016'),
]
operations = [
migrations.RenameField(
model_name='reservation',
old_name='user',
new_name='owner',
),
]
| true | true |
f72fb07aed75906e4fd55adb3081b3b4d85b4c83 | 108 | py | Python | runscript_DDmass.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | runscript_DDmass.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | runscript_DDmass.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | from plotgen_functions import DD_mass_constraints
import sys
q = float(sys.argv[1])
DD_mass_constraints(q) | 18 | 49 | 0.824074 | from plotgen_functions import DD_mass_constraints
import sys
q = float(sys.argv[1])
DD_mass_constraints(q) | true | true |
f72fb1455f5a6d221b2e71016d342136e0b43efe | 127 | py | Python | instance/config.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | 3 | 2017-02-27T02:13:52.000Z | 2017-03-05T03:54:25.000Z | instance/config.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | null | null | null | instance/config.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | null | null | null | # instance/config.py
SECRET_KEY = 'p9Bv<3Eid9%$i01'
SQLALCHEMY_DATABASE_URI = 'mysql://esss_admin:esss2017@localhost/esss_db'
| 25.4 | 73 | 0.787402 |
SECRET_KEY = 'p9Bv<3Eid9%$i01'
SQLALCHEMY_DATABASE_URI = 'mysql://esss_admin:esss2017@localhost/esss_db'
| true | true |
f72fb15cca4227d9405d5ece1245eb1451ce43c4 | 134,835 | py | Python | Lib/test/test_ssl.py | harveyqing/read_cPython_source | 3ff91638c8c9df6e5ac8dd5235447b5571781535 | [
"PSF-2.0"
] | 36 | 2015-02-04T10:43:31.000Z | 2022-03-30T13:01:12.000Z | Lib/test/test_ssl.py | harveyqing/read_cPython_source | 3ff91638c8c9df6e5ac8dd5235447b5571781535 | [
"PSF-2.0"
] | 9 | 2015-03-17T05:56:16.000Z | 2021-11-17T09:31:50.000Z | src/test/python/cpython-3f944f44ee41/Lib/test/test_ssl.py | bkiers/python3-parser | 38496e94b3935e5abca6ab86fd98136c51f92fd7 | [
"MIT"
] | 22 | 2015-05-13T17:37:35.000Z | 2022-01-25T06:24:42.000Z | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
from u... | 44.780804 | 117 | 0.553135 |
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
from unittest import mock
ssl = support.impo... | true | true |
f72fb180675bc7af5ad554ef5a79f7262a0c0838 | 5,272 | py | Python | devel/lib/python2.7/dist-packages/learning_topic/msg/_Person.py | youxiangming/ROS_learning | 29a88ed40982c71d32d469498ad67fba5d9d0943 | [
"MIT"
] | null | null | null | devel/lib/python2.7/dist-packages/learning_topic/msg/_Person.py | youxiangming/ROS_learning | 29a88ed40982c71d32d469498ad67fba5d9d0943 | [
"MIT"
] | null | null | null | devel/lib/python2.7/dist-packages/learning_topic/msg/_Person.py | youxiangming/ROS_learning | 29a88ed40982c71d32d469498ad67fba5d9d0943 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from learning_topic/Person.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Person(genpy.Message):
_md5sum = "8cf74e85a44e7a35ab62353a46e326a3"
_ty... | 30.830409 | 145 | 0.628604 | import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Person(genpy.Message):
_md5sum = "8cf74e85a44e7a35ab62353a46e326a3"
_type = "learning_topic/Person"
_has_header = False _full_text = """string name
uint8 sex
uint8 age
uint8 unknown =0
uint8 ma... | true | true |
f72fb182d47331d80baf9b9fb6534806b6d38c8b | 1,856 | py | Python | appengine/tictactoe/webhandler.py | salendron/ai-kindergarten | 02782730753b7d9b70fcff2dcfbff0f7a4ed6e0e | [
"MIT"
] | null | null | null | appengine/tictactoe/webhandler.py | salendron/ai-kindergarten | 02782730753b7d9b70fcff2dcfbff0f7a4ed6e0e | [
"MIT"
] | null | null | null | appengine/tictactoe/webhandler.py | salendron/ai-kindergarten | 02782730753b7d9b70fcff2dcfbff0f7a4ed6e0e | [
"MIT"
] | null | null | null | from bottle import SimpleTemplate
from bottle import request
from .game import Game
from .player import AIPlayer
from .recorder import save_game, get_stats, get_last_training
player_names = {
'm': 'Bob',
'h': 'You'
}
def render_field(idx, game):
current_state = game.states[-1]
if current_state[idx] ... | 25.081081 | 95 | 0.609375 | from bottle import SimpleTemplate
from bottle import request
from .game import Game
from .player import AIPlayer
from .recorder import save_game, get_stats, get_last_training
player_names = {
'm': 'Bob',
'h': 'You'
}
def render_field(idx, game):
current_state = game.states[-1]
if current_state[idx] ... | true | true |
f72fb19d379b24571a1791dda2d07bd1524c5a49 | 1,313 | py | Python | Dynamic Obstacle Simulation/config.py | TSummersLab/Risk_Bounded_Nonlinear_Robot_Motion_Planning | 717b9f07f4ed625ee33ab8ec22ce78dc2907d759 | [
"MIT"
] | 3 | 2022-01-07T19:37:03.000Z | 2022-03-15T08:50:28.000Z | Dynamic Obstacle Simulation/config.py | TSummersLab/Risk_Bounded_Nonlinear_Robot_Motion_Planning | 717b9f07f4ed625ee33ab8ec22ce78dc2907d759 | [
"MIT"
] | null | null | null | Dynamic Obstacle Simulation/config.py | TSummersLab/Risk_Bounded_Nonlinear_Robot_Motion_Planning | 717b9f07f4ed625ee33ab8ec22ce78dc2907d759 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 16 12:59:37 2021
@author: vxr131730
Author: Venkatraman Renganathan
Email: vrengana@utdallas.edu
Github: https://github.com/venkatramanrenganathan
- Create a configuration file for RRT*. Functions that use RRT* outputs
will use some of these configurations
... | 24.314815 | 80 | 0.677837 | import numpy as np
import pickle
maxIter = 100
Trial_Num = 1
Trial_Total = 100
num_states = 6
num_outputs = 4
total_dim = num_states + num_outputs
estimatorSelector = 1
DRFlag = True
carTrackHorizon = 4
dynamicObs = True
obsVelocities = [0.10, 0.20]
velocitySelector = 0
if dynam... | true | true |
f72fb1b068a952dc4984202737257c15d8acf40e | 2,692 | py | Python | koans/about_asserts.py | sayeda-khaled/python_koans | c834a95ece3cb1dd87b5c9923089c8c5b60b7154 | [
"MIT"
] | null | null | null | koans/about_asserts.py | sayeda-khaled/python_koans | c834a95ece3cb1dd87b5c9923089c8c5b60b7154 | [
"MIT"
] | null | null | null | koans/about_asserts.py | sayeda-khaled/python_koans | c834a95ece3cb1dd87b5c9923089c8c5b60b7154 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
"""
We shall contemplate truth by testing reality, via asserts.
"""
# Confused? This video should help:
#
# http://bit.ly/about_asserts... | 31.302326 | 91 | 0.614413 |
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
self.assertTrue(True)
def test_assert_with_message(self):
self.assertTrue(True, "This should be True -- Please fix this")
def test_fill_in_values(self):
... | true | true |
f72fb25142c4d22ce4847d1c4623c584a3ad02c2 | 1,326 | py | Python | aimsprop/pes.py | mtzgroup/aimsprop | 464d88ad7a817da73027fd2ab7b12476bf59f83d | [
"MIT"
] | 1 | 2022-03-28T13:11:56.000Z | 2022-03-28T13:11:56.000Z | aimsprop/pes.py | mtzgroup/aimsprop | 464d88ad7a817da73027fd2ab7b12476bf59f83d | [
"MIT"
] | 11 | 2021-03-17T17:53:58.000Z | 2021-07-17T17:59:25.000Z | aimsprop/pes.py | mtzgroup/aimsprop | 464d88ad7a817da73027fd2ab7b12476bf59f83d | [
"MIT"
] | 2 | 2021-04-05T08:36:35.000Z | 2021-05-20T22:12:12.000Z | import numpy as np
from .bundle import Bundle
def compute_pes(
bundle: Bundle,
carrier_frequency: float,
alpha: float,
eKT: np.ndarray,
) -> Bundle:
"""Compute the simple photoelectron spectroscopy, with Guassian blurring
User is responsible for calculating and assigning properties to the b... | 29.466667 | 86 | 0.610106 | import numpy as np
from .bundle import Bundle
def compute_pes(
bundle: Bundle,
carrier_frequency: float,
alpha: float,
eKT: np.ndarray,
) -> Bundle:
for frame in bundle.frames:
IPs = frame.properties["IP"]
dyson_norms = frame.properties["dyson_norms"]
pes = np.zeros_like... | true | true |
f72fb25f8ffe85e2f2a3357c66821d11c44d4856 | 17,524 | py | Python | salesforce/xmltodict.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 29 | 2016-12-15T07:14:44.000Z | 2022-03-17T17:24:08.000Z | salesforce/xmltodict.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 5 | 2017-02-14T02:04:44.000Z | 2019-02-19T19:25:22.000Z | salesforce/xmltodict.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 12 | 2016-12-16T08:02:45.000Z | 2020-02-20T00:00:58.000Z | #!/usr/bin/env python
"Makes working with XML feel like you are working with JSON"
## https://github.com/martinblech/xmltodict
try:
from defusedexpat import pyexpat as expat
except ImportError:
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
... | 37.127119 | 80 | 0.579605 |
try:
from defusedexpat import pyexpat as expat
except ImportError:
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
try: from cStringIO import StringIO
except ImportError: try:
from StringIO import StringIO
except ImportE... | true | true |
f72fb28880a0595528ca930a65ee989250ef37de | 410 | py | Python | src/index.py | dekokun/aws-lambda-parallelization-factor-test | a9d73cd15a3549e1b908cf4504c136173f54839c | [
"MIT"
] | 1 | 2019-12-19T10:37:50.000Z | 2019-12-19T10:37:50.000Z | src/index.py | dekokun/aws-lambda-parallelization-factor-test | a9d73cd15a3549e1b908cf4504c136173f54839c | [
"MIT"
] | null | null | null | src/index.py | dekokun/aws-lambda-parallelization-factor-test | a9d73cd15a3549e1b908cf4504c136173f54839c | [
"MIT"
] | null | null | null | import base64
import json
import time
def lambda_handler(event, context):
print ('start handler')
count = len(event['Records'])
print ('Get record count:')
print (count)
for record in event['Records']:
payload = base64.b64decode(record['kinesis']['data']).decode("utf-8")
print("Pa... | 24.117647 | 77 | 0.643902 | import base64
import json
import time
def lambda_handler(event, context):
print ('start handler')
count = len(event['Records'])
print ('Get record count:')
print (count)
for record in event['Records']:
payload = base64.b64decode(record['kinesis']['data']).decode("utf-8")
print("Pa... | true | true |
f72fb295397c8e42dff827498e5277948595c2fd | 926 | py | Python | backend/migrations/versions/d2f3d6010615_modify_message_table.py | ClassesOver/Stories | 419eb30b1afe053772be5e3e65b0cd1038eb0c81 | [
"Apache-2.0"
] | 1 | 2020-12-29T09:06:37.000Z | 2020-12-29T09:06:37.000Z | backend/migrations/versions/d2f3d6010615_modify_message_table.py | ClassesOver/blog | 419eb30b1afe053772be5e3e65b0cd1038eb0c81 | [
"Apache-2.0"
] | null | null | null | backend/migrations/versions/d2f3d6010615_modify_message_table.py | ClassesOver/blog | 419eb30b1afe053772be5e3e65b0cd1038eb0c81 | [
"Apache-2.0"
] | null | null | null | """modify message table
Revision ID: d2f3d6010615
Revises: fbb3ebcf5f90
Create Date: 2020-12-24 11:56:01.558233
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd2f3d6010615'
down_revision = 'fbb3ebcf5f90'
branch_labels = None
depends_on = None
def upgrade():... | 26.457143 | 88 | 0.698704 | from alembic import op
import sqlalchemy as sa
revision = 'd2f3d6010615'
down_revision = 'fbb3ebcf5f90'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table('message', schema=None) as batch_op:
batch_op.add_column(sa.Column('res_id', sa.Integer(), nullable=True))
b... | true | true |
f72fb2fc1f4ca1f1629f405f76b905ba489cd3be | 1,136 | py | Python | app/core/tests/test_model.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | app/core/tests/test_model.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | app/core/tests/test_model.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTest(TestCase):
def test_create_user_with_email_successfully(self):
email = 'test@test.com'
password = '12345'
user = get_user_model().objects.create_user(
email=email,
passw... | 32.457143 | 79 | 0.649648 | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTest(TestCase):
def test_create_user_with_email_successfully(self):
email = 'test@test.com'
password = '12345'
user = get_user_model().objects.create_user(
email=email,
passw... | true | true |
f72fb3a7fe0c4c14b9ceafe1c2d3cdb20fb8fa98 | 1,358 | py | Python | src/araugment/augment.py | ashaheedq/araugment | 53436c0c00c924f80238f9c4ae09c9966953e4d1 | [
"MIT"
] | null | null | null | src/araugment/augment.py | ashaheedq/araugment | 53436c0c00c924f80238f9c4ae09c9966953e4d1 | [
"MIT"
] | null | null | null | src/araugment/augment.py | ashaheedq/araugment | 53436c0c00c924f80238f9c4ae09c9966953e4d1 | [
"MIT"
] | null | null | null | # coding:utf-8
# author Abdulshaheed Alqunber
# version : 1.0.0
from google_trans_new import google_translator
import markovify as mk
def back_translate(text, language_src="ar", language_dst="zh"):
"""Translate text to a foreign language then translate back to original language to augment data
Parameters:
... | 31.581395 | 110 | 0.700295 | from google_trans_new import google_translator
import markovify as mk
def back_translate(text, language_src="ar", language_dst="zh"):
try:
t = google_translator()
translated_text = t.translate(text.strip(), language_dst)
translated_back = t.translate(translated_text, ... | true | true |
f72fb5cbe866769c53578f3efd0203eed8351817 | 11,982 | py | Python | configs/visualgenome_kr/VGCOCO_PredCls_motif_wS82_linearranker_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/visualgenome_kr/VGCOCO_PredCls_motif_wS82_linearranker_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/visualgenome_kr/VGCOCO_PredCls_motif_wS82_linearranker_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # dataset settings
dataset_type = 'VisualGenomeKRDataset'
data_root = 'data/visualgenomekr/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
... | 36.867692 | 115 | 0.580204 | dataset_type = 'VisualGenomeKRDataset'
data_root = 'data/visualgenomekr/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
dict(type='Resiz... | true | true |
f72fb606aa4f0da5563e1b53b0ee4a213e3fad46 | 777 | py | Python | bindings/python/tools/python/ostk/mathematics/__init__.py | open-space-collective/library-mathematics | fdb4769a56a8fe35ffefb01a79c03cfca1f91958 | [
"Apache-2.0"
] | 5 | 2018-08-20T06:47:24.000Z | 2019-07-15T03:36:52.000Z | bindings/python/tools/python/ostk/mathematics/__init__.py | open-space-collective/open-space-toolkit-mathematics | 4b97f97f4aaa87bff848381a3519c6f764461378 | [
"Apache-2.0"
] | 6 | 2020-01-05T20:18:18.000Z | 2021-10-14T09:36:44.000Z | bindings/python/tools/python/ostk/mathematics/__init__.py | open-space-collective/open-space-toolkit-mathematics | 4b97f97f4aaa87bff848381a3519c6f764461378 | [
"Apache-2.0"
] | 2 | 2020-03-05T18:18:13.000Z | 2020-04-07T17:42:24.000Z | ################################################################################################################################################################
# @project Open Space Toolkit ▸ Mathematics
# @file bindings/python/tools/python/ostk/mathematics/__init__.py
# @author Lucas Brémond... | 51.8 | 160 | 0.262548 |
from ostk.core import *
from .OpenSpaceToolkitMathematicsPy import *
| true | true |
f72fb630e3bedcdefa0eb57e63dd067409e8bfcd | 440 | py | Python | src/core/__init__.py | el-ideal-ideas/MocaCommands | 33dda0b05ca3b34f4855ff264bcf70d016dfb1c0 | [
"MIT"
] | null | null | null | src/core/__init__.py | el-ideal-ideas/MocaCommands | 33dda0b05ca3b34f4855ff264bcf70d016dfb1c0 | [
"MIT"
] | null | null | null | src/core/__init__.py | el-ideal-ideas/MocaCommands | 33dda0b05ca3b34f4855ff264bcf70d016dfb1c0 | [
"MIT"
] | null | null | null | # -- Imports --------------------------------------------------------------------------
from .core import (
VERSION, TOP_DIR, CONFIG_DIR, LOG_DIR, SRC_DIR, STATIC_DIR, STORAGE_DIR, SYSTEM_CONFIG, SANIC_CONFIG, SERVER_CONFIG,
COMMANDS_DIR, COMMANDS_CONFIG, IP_BLACKLIST_FILE, API_KEY_FILE, SCRIPTS_DIR, system_co... | 48.888889 | 120 | 0.511364 |
from .core import (
VERSION, TOP_DIR, CONFIG_DIR, LOG_DIR, SRC_DIR, STATIC_DIR, STORAGE_DIR, SYSTEM_CONFIG, SANIC_CONFIG, SERVER_CONFIG,
COMMANDS_DIR, COMMANDS_CONFIG, IP_BLACKLIST_FILE, API_KEY_FILE, SCRIPTS_DIR, system_config, commands, ip_blacklist
)
| true | true |
f72fb6db38ad0943de7ba102448dbf868e181c11 | 18,487 | py | Python | MultiServer.py | Schulzer99/MultiWorld-Utilities | 031f7e6e21dc80290524e51c165cd28ac10747b3 | [
"MIT"
] | null | null | null | MultiServer.py | Schulzer99/MultiWorld-Utilities | 031f7e6e21dc80290524e51c165cd28ac10747b3 | [
"MIT"
] | null | null | null | MultiServer.py | Schulzer99/MultiWorld-Utilities | 031f7e6e21dc80290524e51c165cd28ac10747b3 | [
"MIT"
] | null | null | null | import argparse
import asyncio
import functools
import json
import logging
import re
import shlex
import urllib.request
import zlib
import ModuleUpdate
ModuleUpdate.update()
import websockets
import aioconsole
import Items
import Regions
from MultiClient import ReceivedItem, get_item_name_from_id, get_location_name_... | 42.793981 | 230 | 0.584411 | import argparse
import asyncio
import functools
import json
import logging
import re
import shlex
import urllib.request
import zlib
import ModuleUpdate
ModuleUpdate.update()
import websockets
import aioconsole
import Items
import Regions
from MultiClient import ReceivedItem, get_item_name_from_id, get_location_name_... | true | true |
f72fb70520827d455a85f96859c23ec6801cf6f3 | 5,184 | py | Python | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 1 | 2021-11-16T00:58:43.000Z | 2021-11-16T00:58:43.000Z | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 16 | 2021-05-17T19:24:47.000Z | 2021-12-15T13:57:34.000Z | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 1 | 2021-05-12T19:11:52.000Z | 2021-05-12T19:11:52.000Z | import json
import pytest
from ..entrypoint import (
AudiobooksEntryPoint,
EbooksEntryPoint,
EntryPoint,
EverythingEntryPoint,
MediumEntryPoint,
)
from ..external_search import Filter
from ..model import Edition, Work
from ..testing import DatabaseTest
class TestEntryPoint(DatabaseTest):
def... | 34.331126 | 82 | 0.673032 | import json
import pytest
from ..entrypoint import (
AudiobooksEntryPoint,
EbooksEntryPoint,
EntryPoint,
EverythingEntryPoint,
MediumEntryPoint,
)
from ..external_search import Filter
from ..model import Edition, Work
from ..testing import DatabaseTest
class TestEntryPoint(DatabaseTest):
def... | true | true |
f72fb746949f5509b0ded3a7b05fc061d6d0201a | 879 | bzl | Python | third_party/farmhash/workspace.bzl | dmpiergiacomo/tensorflow | 0ecdc6dc2dbc2381c9317f274bd39281294dfc97 | [
"Apache-2.0"
] | 6 | 2021-03-30T07:42:04.000Z | 2022-03-23T02:42:36.000Z | third_party/farmhash/workspace.bzl | dmpiergiacomo/tensorflow | 0ecdc6dc2dbc2381c9317f274bd39281294dfc97 | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | third_party/farmhash/workspace.bzl | dmpiergiacomo/tensorflow | 0ecdc6dc2dbc2381c9317f274bd39281294dfc97 | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | """Provides the repository macro to import farmhash."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports farmhash."""
# Attention: tools parse and update these lines.
FARMHASH_COMMIT = "816a4ae622e964763ca0862d9dbd19324a1eaf45"
FARMHASH_SHA256 = "6560547c63e4af82b0f202cb710cea... | 39.954545 | 151 | 0.697383 |
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
FARMHASH_COMMIT = "816a4ae622e964763ca0862d9dbd19324a1eaf45"
FARMHASH_SHA256 = "6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0"
tf_http_archive(
name = "farmhash_archive",
build_file = "//third_party/farm... | true | true |
f72fb7689d8d911e8d95780e9541175223f17521 | 2,251 | py | Python | apis/forecast.py | mrasap/powderbooking_backend | ffc6e31f52bd78a18293adbfbb30cd0211a4700c | [
"Apache-2.0"
] | null | null | null | apis/forecast.py | mrasap/powderbooking_backend | ffc6e31f52bd78a18293adbfbb30cd0211a4700c | [
"Apache-2.0"
] | null | null | null | apis/forecast.py | mrasap/powderbooking_backend | ffc6e31f52bd78a18293adbfbb30cd0211a4700c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Michael Kemna.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 38.810345 | 90 | 0.749889 | from flask_restplus import Namespace, Resource
from powderbooking.models import model_forecast
from sqlalchemy import MetaData
from database import db
from database.query import Query
from utils.convert_models import convert_sqlalchemy_to_restplus_model
api = Namespace('forecast', description='Weather reports of a o... | true | true |
f72fb77842fa2f02ed07d03d38852d1b6dade3ed | 1,296 | py | Python | src/fetchcode/vcs/pip/_internal/utils/pkg_resources.py | quepop/fetchcode | ac2461bdf7a249d8815987b4d421dbc615c043b9 | [
"Apache-2.0"
] | 7 | 2019-10-04T07:27:41.000Z | 2021-06-07T04:39:18.000Z | src/fetchcode/vcs/pip/_internal/utils/pkg_resources.py | quepop/fetchcode | ac2461bdf7a249d8815987b4d421dbc615c043b9 | [
"Apache-2.0"
] | 64 | 2019-10-07T12:40:56.000Z | 2022-02-17T18:44:37.000Z | src/fetchcode/vcs/pip/_internal/utils/pkg_resources.py | quepop/fetchcode | ac2461bdf7a249d8815987b4d421dbc615c043b9 | [
"Apache-2.0"
] | 16 | 2019-10-04T08:48:12.000Z | 2021-06-11T01:22:56.000Z | from fetchcode.vcs.pip._vendor.pkg_resources import yield_lines
from fetchcode.vcs.pip._vendor.six import ensure_str
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Dict, Iterable, List
class DictMetadata(object):
"""IMetadataProvider that re... | 28.8 | 71 | 0.631944 | from fetchcode.vcs.pip._vendor.pkg_resources import yield_lines
from fetchcode.vcs.pip._vendor.six import ensure_str
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Dict, Iterable, List
class DictMetadata(object):
def __init__(self, metadata)... | true | true |
f72fb8bd9479fd40d29757e53cc63e0a56a9ebf3 | 757 | py | Python | leo/plugins/quit_leo.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 1 | 2021-02-08T21:22:38.000Z | 2021-02-08T21:22:38.000Z | leo/plugins/quit_leo.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | leo/plugins/quit_leo.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:edream.110203113231.734: * @file ../plugins/quit_leo.py
""" Shows how to force Leo to quit."""
#@@language python
#@@tabwidth -4
from leo.core import leoGlobals as g
def init():
'''Return True if the plugin has loaded successfully.'''
ok = not g.app.unitTesting # Not for unit testing.... | 30.28 | 72 | 0.620872 | from leo.core import leoGlobals as g
def init():
ok = not g.app.unitTesting if ok:
def forceLeoToQuit(tag, keywords):
if not g.app.initing:
g.pr("forceLeoToQuit", tag)
g.app.forceShutdown()
g.pr(__doc__)
g.registerHandler("id... | true | true |
f72fb9520e3654537387e3873817fd1158160606 | 1,721 | py | Python | deeptennis/data/transforms.py | sethah/deeptennis | a689c5f1d6f5ff1d665aec99b8db6262d3442c3a | [
"MIT"
] | 27 | 2018-11-23T21:37:14.000Z | 2021-11-22T08:44:35.000Z | deeptennis/data/transforms.py | sethah/deeptennis | a689c5f1d6f5ff1d665aec99b8db6262d3442c3a | [
"MIT"
] | 6 | 2019-07-09T16:26:56.000Z | 2021-05-17T17:29:42.000Z | deeptennis/data/transforms.py | sethah/deeptennis | a689c5f1d6f5ff1d665aec99b8db6262d3442c3a | [
"MIT"
] | 4 | 2019-06-11T06:44:30.000Z | 2021-02-27T14:49:02.000Z | import numpy as np
import albumentations.augmentations.functional as af
from albumentations.core.transforms_interface import DualTransform
from allencv.data.transforms import _ImageTransformWrapper, ImageTransform
class CourtKeypointFlip(DualTransform):
"""Flip the input horizontally around the y-axis.
Arg... | 34.42 | 103 | 0.651365 | import numpy as np
import albumentations.augmentations.functional as af
from albumentations.core.transforms_interface import DualTransform
from allencv.data.transforms import _ImageTransformWrapper, ImageTransform
class CourtKeypointFlip(DualTransform):
def apply(self, img, **params):
if img.ndim == 3 ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.