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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7418029a9596ca5b6ace80139ba2fdd4ed7b98b | 651 | py | Python | migrations/versions/98f414e72943_.py | ansu5555/mt-backend | b54089e5efaa62e94d12888834ca9bbc48eec149 | [
"MIT"
] | 1 | 2019-03-27T19:20:59.000Z | 2019-03-27T19:20:59.000Z | migrations/versions/98f414e72943_.py | ansu5555/mt-backend | b54089e5efaa62e94d12888834ca9bbc48eec149 | [
"MIT"
] | null | null | null | migrations/versions/98f414e72943_.py | ansu5555/mt-backend | b54089e5efaa62e94d12888834ca9bbc48eec149 | [
"MIT"
] | 1 | 2019-07-07T03:47:09.000Z | 2019-07-07T03:47:09.000Z | """empty message
Revision ID: 98f414e72943
Revises: 4f65c2238756
Create Date: 2019-04-30 23:46:07.283010
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '98f414e72943'
down_revision = '4f65c2238756'
branch_labels = None
depends_on = None
def upgrade():
# ... | 22.448276 | 77 | 0.689708 | from alembic import op
import sqlalchemy as sa
revision = '98f414e72943'
down_revision = '4f65c2238756'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f741811734e4eb69a7fbc204add46c28e2162b03 | 757 | py | Python | Renovavel.py | equipesge/MDI_PDE_2030 | 9300a7f6aa933550b41bd06360ceace941e21af7 | [
"MIT"
] | 1 | 2022-03-25T17:21:40.000Z | 2022-03-25T17:21:40.000Z | Renovavel.py | equipesge/MDI_PDE_2030 | 9300a7f6aa933550b41bd06360ceace941e21af7 | [
"MIT"
] | null | null | null | Renovavel.py | equipesge/MDI_PDE_2030 | 9300a7f6aa933550b41bd06360ceace941e21af7 | [
"MIT"
] | 2 | 2021-07-20T19:27:12.000Z | 2022-03-25T17:53:25.000Z | from Usina import Usina;
from RecebeDados import RecebeDados;
class Renovavel (Usina):
def __init__(self, recebe_dados, abaRenov, offset, iRenov):
# define fonte_dados como o objeto da classe RecebeDados e o nome da aba com as usinas UHE
self.nomeAba = abaRenov;
self.... | 37.85 | 101 | 0.643329 | from Usina import Usina;
from RecebeDados import RecebeDados;
class Renovavel (Usina):
def __init__(self, recebe_dados, abaRenov, offset, iRenov):
self.nomeAba = abaRenov;
self.fonte_dados = recebe_dados;
self.indexUsinaInterno = iRenov;
... | true | true |
f741830513a6b6e3dad4b852dcc062c391edb2e2 | 18,153 | py | Python | pystruct/learners/n_slack_ssvm.py | LemonLison/pystruct | 5606e643d1a0a3701b93b848a2a02c49e83c4f1e | [
"BSD-2-Clause"
] | 4 | 2017-04-18T09:32:07.000Z | 2018-08-10T06:27:59.000Z | pystruct/learners/n_slack_ssvm.py | kingjr/pystruct | 23c6d8f6ab34a88b63386a595debbfdfa13345fe | [
"BSD-2-Clause"
] | 1 | 2018-10-02T14:36:34.000Z | 2018-10-02T14:36:34.000Z | pystruct/learners/n_slack_ssvm.py | kingjr/pystruct | 23c6d8f6ab34a88b63386a595debbfdfa13345fe | [
"BSD-2-Clause"
] | 1 | 2019-09-20T19:56:24.000Z | 2019-09-20T19:56:24.000Z | ######################
# (c) 2012 Andreas Mueller <amueller@ais.uni-bonn.de>
# License: BSD 3-clause
#
# Implements structured SVM as described in Tsochantaridis et. al.
# Support Vector Machines Learning for Interdependent
# and Structures Output Spaces
from time import time
import numpy as np
import cvxopt
import c... | 42.118329 | 104 | 0.570925 | unwrap_pairwise, find_constraint
class NSlackSSVM(BaseSSVM):
def __init__(self, model, max_iter=100, C=1.0, check_constraints=True,
verbose=0, negativity_constraint=None, n_jobs=1,
break_on_bad=False, show_loss_every=0, batch_size=100,
tol=1e-3, inactive_thresh... | true | true |
f741832281584f42536b01d706feac7af6edef4a | 1,421 | py | Python | ui/middleware.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | null | null | null | ui/middleware.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | 191 | 2019-03-01T14:00:57.000Z | 2021-06-06T23:01:57.000Z | ui/middleware.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | 1 | 2020-01-13T13:07:49.000Z | 2020-01-13T13:07:49.000Z | import logging
from typing import Set
import falcon
from common.consts import HTTP_WRITE_METHODS
from common.falcon_utils import auth_token
from common.util import is_public
from ui import BackendController
class ContentTypeValidator:
def process_resource(self, req: falcon.Request, _resp: falcon.Response, resou... | 37.394737 | 134 | 0.718508 | import logging
from typing import Set
import falcon
from common.consts import HTTP_WRITE_METHODS
from common.falcon_utils import auth_token
from common.util import is_public
from ui import BackendController
class ContentTypeValidator:
def process_resource(self, req: falcon.Request, _resp: falcon.Response, resou... | true | true |
f74184135f66918bffacb97913e42eb60ee19da0 | 983 | py | Python | api-site/core/admin.py | Basel-h-ashour/recipe-app-api | 266b41c5fe950cb0adf1292de328d44f59a09560 | [
"MIT"
] | null | null | null | api-site/core/admin.py | Basel-h-ashour/recipe-app-api | 266b41c5fe950cb0adf1292de328d44f59a09560 | [
"MIT"
] | null | null | null | api-site/core/admin.py | Basel-h-ashour/recipe-app-api | 266b41c5fe950cb0adf1292de328d44f59a09560 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email',... | 25.205128 | 64 | 0.526958 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email',... | true | true |
f74184a99db0ef4c8a715360c6d769d1aa83ebc9 | 868 | py | Python | medical_prescription/user/views/sendmail.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 11 | 2017-09-19T00:29:40.000Z | 2018-04-05T23:52:39.000Z | medical_prescription/user/views/sendmail.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 271 | 2017-09-09T00:07:28.000Z | 2017-12-07T05:00:45.000Z | medical_prescription/user/views/sendmail.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 26 | 2017-08-31T20:48:49.000Z | 2018-03-21T15:11:27.000Z | # standard library
import threading
# django
from django.core.mail import send_mail
# local django
from user import constants
class SendMail(threading.Thread):
"""
Responsible to send email in background.
"""
def __init__(self, email, HealthProfessional, SendInvitationProfile):
self.email = ... | 31 | 90 | 0.692396 |
import threading
from django.core.mail import send_mail
from user import constants
class SendMail(threading.Thread):
def __init__(self, email, HealthProfessional, SendInvitationProfile):
self.email = email
self.HealthProfessional = HealthProfessional
self.SendInvitationProfile = SendI... | true | true |
f741852de67f56f5943cacf7b231c8ffecaf7bc2 | 2,404 | py | Python | mig_main/admin.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 4 | 2017-10-02T17:44:14.000Z | 2020-02-14T17:13:57.000Z | mig_main/admin.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 152 | 2015-01-04T00:08:44.000Z | 2022-01-13T00:43:03.000Z | mig_main/admin.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 4 | 2015-04-16T04:27:05.000Z | 2021-03-21T20:45:24.000Z | from django.contrib import admin
from mig_main.models import (
UserProfile,
OfficerPosition,
Standing,
Status,
Major,
ShirtSize,
TBPChapter,
AcademicTerm,
... | 27.318182 | 54 | 0.400998 | from django.contrib import admin
from mig_main.models import (
UserProfile,
OfficerPosition,
Standing,
Status,
Major,
ShirtSize,
TBPChapter,
AcademicTerm,
... | true | true |
f74187f73a65f8f43377f77171db07f4647744b4 | 2,755 | py | Python | faassupervisor/faas/binary/supervisor.py | tomberek/faas-supervisor | 4b7267773d8ecb715584e1a2e56aeb618a714b1c | [
"Apache-2.0"
] | null | null | null | faassupervisor/faas/binary/supervisor.py | tomberek/faas-supervisor | 4b7267773d8ecb715584e1a2e56aeb618a714b1c | [
"Apache-2.0"
] | null | null | null | faassupervisor/faas/binary/supervisor.py | tomberek/faas-supervisor | 4b7267773d8ecb715584e1a2e56aeb618a714b1c | [
"Apache-2.0"
] | null | null | null | # Copyright (C) GRyCAP - I3M - UPV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 43.730159 | 99 | 0.669328 |
import subprocess
import sys
from faassupervisor.faas import DefaultSupervisor
from faassupervisor.logger import get_logger
from faassupervisor.utils import SysUtils, FileUtils, StrUtils
class BinarySupervisor(DefaultSupervisor):
_SCRIPT_FILE_NAME = 'script.sh'
def __init__(self):
get_... | true | true |
f741883fa92380aa493607bb6ff8ae0231aafb4f | 5,724 | py | Python | simpleflow/log.py | David-Wobrock/simpleflow | 09f59105b48ae79aef37b506bbde0cd1f2c360d1 | [
"MIT"
] | 69 | 2015-02-24T00:49:40.000Z | 2022-02-05T02:35:04.000Z | simpleflow/log.py | David-Wobrock/simpleflow | 09f59105b48ae79aef37b506bbde0cd1f2c360d1 | [
"MIT"
] | 295 | 2015-02-06T11:02:00.000Z | 2022-03-21T11:01:34.000Z | simpleflow/log.py | David-Wobrock/simpleflow | 09f59105b48ae79aef37b506bbde0cd1f2c360d1 | [
"MIT"
] | 27 | 2015-08-31T22:14:42.000Z | 2022-02-08T07:25:01.000Z | import logging.config
import sys
from datetime import datetime
from . import logging_context, settings
RED = "\033[91m"
GREEN = "\033[92m"
YELLOW = "\033[93m"
BLUE = "\033[94m"
ORANGE = "\033[38;5;214m"
END = "\033[0m"
class ColorModes(object):
AUTO = "auto"
ALWAYS = "always"
NEVER = "never"
color_mod... | 31.8 | 118 | 0.570231 | import logging.config
import sys
from datetime import datetime
from . import logging_context, settings
RED = "\033[91m"
GREEN = "\033[92m"
YELLOW = "\033[93m"
BLUE = "\033[94m"
ORANGE = "\033[38;5;214m"
END = "\033[0m"
class ColorModes(object):
AUTO = "auto"
ALWAYS = "always"
NEVER = "never"
color_mod... | true | true |
f74188cf4aee2eed262a552397b43050cf014f64 | 19,156 | py | Python | tests/dataset/test_dataset.py | ANazaret/scVI | 94a4a31b48b468da63417ef191db35b8bc98fbc6 | [
"MIT"
] | 1 | 2021-11-25T16:04:15.000Z | 2021-11-25T16:04:15.000Z | tests/dataset/test_dataset.py | ANazaret/scVI | 94a4a31b48b468da63417ef191db35b8bc98fbc6 | [
"MIT"
] | null | null | null | tests/dataset/test_dataset.py | ANazaret/scVI | 94a4a31b48b468da63417ef191db35b8bc98fbc6 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
import copy
from scvi.dataset import CortexDataset, GeneExpressionDataset
from scvi.dataset.dataset import remap_categories, CellMeasurement
class TestGeneExpressionDataset(TestCase):
def test_populate_from_data(self):
data = np.ones((25, 10)) * 100
... | 41.195699 | 88 | 0.611453 | from unittest import TestCase
import numpy as np
import copy
from scvi.dataset import CortexDataset, GeneExpressionDataset
from scvi.dataset.dataset import remap_categories, CellMeasurement
class TestGeneExpressionDataset(TestCase):
def test_populate_from_data(self):
data = np.ones((25, 10)) * 100
... | true | true |
f74188f78260ec762de0025163fd477eb97cc78e | 4,892 | py | Python | examples/transfer_bo.py | zhanglei1172/bbobenchmark | 841bffdddc1320ac2676e378d20f8b176a7e6cf7 | [
"MIT"
] | 2 | 2021-09-06T02:06:22.000Z | 2021-12-09T10:46:56.000Z | examples/transfer_bo.py | zhanglei1172/bbobenchmark | 841bffdddc1320ac2676e378d20f8b176a7e6cf7 | [
"MIT"
] | null | null | null | examples/transfer_bo.py | zhanglei1172/bbobenchmark | 841bffdddc1320ac2676e378d20f8b176a7e6cf7 | [
"MIT"
] | null | null | null | import numpy as np
# import matplotlib.pyplot as plt
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter
from ConfigSpace.conditions import LessThanCondition
# from xbbo.search_algorithm.transfer_tst_optimizer import SMBO
# f... | 48.435644 | 206 | 0.705233 | import numpy as np
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter
from ConfigSpace.conditions import LessThanCondition
from xbbo.search_algorithm.transfer_bo_optimizer import SMBO
from xbbo.search_space.offline_hp... | true | true |
f7418907b25d66bc790315e221ebc06c7b7af295 | 4,690 | py | Python | transitfeed/gtfsobjectbase.py | aalekhpatel07/transitfeed | 490c2342c53885da23bdd18f428073e60f4d8728 | [
"Apache-2.0"
] | null | null | null | transitfeed/gtfsobjectbase.py | aalekhpatel07/transitfeed | 490c2342c53885da23bdd18f428073e60f4d8728 | [
"Apache-2.0"
] | null | null | null | transitfeed/gtfsobjectbase.py | aalekhpatel07/transitfeed | 490c2342c53885da23bdd18f428073e60f4d8728 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2.5
# Copyright (C) 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 38.130081 | 82 | 0.65565 |
from .gtfsfactoryuser import GtfsFactoryUser
class GtfsObjectBase(GtfsFactoryUser):
_REQUIRED_FIELD_NAMES = []
_FIELD_NAMES = _REQUIRED_FIELD_NAMES + []
_DEPRECATED_FIELD_NAMES = []
def __getitem__(self, name):
if name in self.__dict__ and self.__dic... | true | true |
f74189f651bdbece673a242ff673d651e5d4c01a | 97 | py | Python | garry/tl/custom/__init__.py | iSasuke7/Garry | ed222a2ff3f54c800145c77dc0971d9007386b50 | [
"MIT"
] | 2 | 2018-03-31T05:43:23.000Z | 2018-07-11T12:35:50.000Z | garry/tl/custom/__init__.py | iSasuke7/Garry | ed222a2ff3f54c800145c77dc0971d9007386b50 | [
"MIT"
] | 1 | 2018-03-20T21:15:47.000Z | 2018-03-20T21:15:47.000Z | telethon/tl/custom/__init__.py | elmcrest/Telethon | 526517069fadd0afbf8d1c066e68b48eef6827b8 | [
"MIT"
] | 1 | 2019-05-10T21:53:16.000Z | 2019-05-10T21:53:16.000Z | from .draft import Draft
from .dialog import Dialog
from .input_sized_file import InputSizedFile
| 24.25 | 44 | 0.845361 | from .draft import Draft
from .dialog import Dialog
from .input_sized_file import InputSizedFile
| true | true |
f7418b15c7d626aa469a0cbdb93102295faf5bf0 | 2,604 | py | Python | source_pytorch/predict.py | Femi-Tofade/Plagiarism_detector | 026164ec11415bc566f4d817dc79c9cecf06a0c0 | [
"MIT"
] | 2 | 2020-10-18T19:29:46.000Z | 2020-11-30T09:36:58.000Z | source_pytorch/predict.py | Femi-Tofade/Plagiarism_detector | 026164ec11415bc566f4d817dc79c9cecf06a0c0 | [
"MIT"
] | 1 | 2021-03-20T01:50:12.000Z | 2021-03-20T01:50:12.000Z | source_pytorch/predict.py | Femi-Tofade/Plagiarism_detector | 026164ec11415bc566f4d817dc79c9cecf06a0c0 | [
"MIT"
] | 2 | 2020-07-07T07:46:20.000Z | 2021-02-03T16:01:27.000Z | # import libraries
import os
import numpy as np
import torch
from six import BytesIO
# import model from model.py, by name
from model import BinaryClassifier
# default content type is numpy array
NP_CONTENT_TYPE = 'application/x-npy'
# Provided model load function
def model_fn(model_dir):
"""Load... | 32.55 | 111 | 0.68318 |
import os
import numpy as np
import torch
from six import BytesIO
from model import BinaryClassifier
NP_CONTENT_TYPE = 'application/x-npy'
def model_fn(model_dir):
print("Loading model.")
model_info = {}
model_info_path = os.path.join(model_dir, 'model_info.pth')
with open(m... | true | true |
f7418b2530eff6b261b52f9cc8e773ce4fad21f2 | 5,082 | py | Python | telemetry.py | datadrivenempathy/who-wrote-this-server | 586756b761759e69da37937fb67ce025ae448491 | [
"MIT"
] | 1 | 2021-05-04T19:40:58.000Z | 2021-05-04T19:40:58.000Z | telemetry.py | datadrivenempathy/who-wrote-this-server | 586756b761759e69da37937fb67ce025ae448491 | [
"MIT"
] | null | null | null | telemetry.py | datadrivenempathy/who-wrote-this-server | 586756b761759e69da37937fb67ce025ae448491 | [
"MIT"
] | null | null | null | """Utility to log usage statistics.
----
Copyright 2019 Data Driven Empathy LLC
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 us... | 37.094891 | 120 | 0.670602 | import datetime
import hashlib
import multiprocessing
import random
import time
INSERT_TEMPLATE = '''INSERT INTO actions (ipAddressHash, userAgent, page, query, timestampStr) VALUES (?, ?, ?, ?, ?)'''
def run_worker_logic(task_queue, db_connection_generator, min_wait, max_wait, use_question_mark):
if use_quest... | true | true |
f7418b80f2ed85f8dc2f285878ed575c0c38d3d4 | 9,815 | py | Python | desired_state/cli.py | benthomasson/desired-state-controller | d1c0cd1a60f885ff796e0d67a44f4802aebc2048 | [
"Apache-2.0"
] | null | null | null | desired_state/cli.py | benthomasson/desired-state-controller | d1c0cd1a60f885ff796e0d67a44f4802aebc2048 | [
"Apache-2.0"
] | null | null | null | desired_state/cli.py | benthomasson/desired-state-controller | d1c0cd1a60f885ff796e0d67a44f4802aebc2048 | [
"Apache-2.0"
] | null | null | null |
"""
Usage:
desired-state [options] control [<control-id>]
desired-state [options] monitor <current-state.yml> [<rules.yml>]
desired-state [options] from <initial-state.yml> to <new-state.yml> [<rules.yml>]
desired-state [options] update-desired-state <new-state.yml>
desired-state [options] update-... | 30.29321 | 106 | 0.675089 |
from .stream import WebsocketChannel, NullChannel
from .messages import DesiredState, ActualState, Shutdown, now
from .util import ConsoleTraceLog, check_state
from .server import ZMQServerChannel
from .client import ZMQClientChannel
from .monitor import DesiredStateMonitor
from .control import DesiredStateControl
f... | true | true |
f7418bc7f559d0fd6aca8a0d5b25c7876f9a4b1f | 1,082 | py | Python | fresh_life/urls.py | FunnyLee/Fresh_Life | e173bcb3c7d697d3768daf63308d5fae0897ec4e | [
"Apache-2.0"
] | 1 | 2019-09-06T02:17:42.000Z | 2019-09-06T02:17:42.000Z | fresh_life/urls.py | FunnyLee/Fresh_Life | e173bcb3c7d697d3768daf63308d5fae0897ec4e | [
"Apache-2.0"
] | null | null | null | fresh_life/urls.py | FunnyLee/Fresh_Life | e173bcb3c7d697d3768daf63308d5fae0897ec4e | [
"Apache-2.0"
] | null | null | null | """fresh_life URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 38.642857 | 77 | 0.674677 | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^tinymce/', include('tinymce.urls')),
url(r'^user/', include('user.urls', namespace='user')),
url(r'^cart/', include('cart.urls', namespace='cart')),
ur... | true | true |
f7418c47c535bd5b860645c5e9ff66c389a099a1 | 2,073 | py | Python | src/filter_plugins/sdwan_portal_filters.py | bacastelli/nuage-metro | 015975208062077d0112a135d7b134f46605a41b | [
"Apache-2.0"
] | 8 | 2020-05-06T14:17:52.000Z | 2022-03-13T07:53:21.000Z | src/filter_plugins/sdwan_portal_filters.py | bacastelli/nuage-metro | 015975208062077d0112a135d7b134f46605a41b | [
"Apache-2.0"
] | 133 | 2020-04-24T20:05:12.000Z | 2022-03-31T15:59:16.000Z | src/filter_plugins/sdwan_portal_filters.py | bacastelli/nuage-metro | 015975208062077d0112a135d7b134f46605a41b | [
"Apache-2.0"
] | 16 | 2020-04-24T08:38:59.000Z | 2021-09-27T04:53:16.000Z | #!/usr/bin/env/python
import re
import json
# Copyright 2017 Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 34.55 | 104 | 0.717318 |
import re
import json
def string_name_value_helper(name, delimiter, string):
VALUE_RE = "\s*" + delimiter + "\s*(\S+)\s+"
scratch = re.search(name + VALUE_RE, string)
if scratch:
return scratch.group(1)
else:
return "None"
def cluster_status_to_json(string):
WSREP... | true | true |
f7418cf753d3d3b0aaf11f441ae8cd4d9ebdb609 | 9,251 | py | Python | core/imbox/parser.py | chao-lv/ok-mail-helper | 379907d6ba64a82e3dece2f8422130616e616922 | [
"MIT"
] | 9 | 2020-10-23T14:10:40.000Z | 2021-09-26T12:48:31.000Z | core/imbox/parser.py | chao-lv/ok-mail-helper | 379907d6ba64a82e3dece2f8422130616e616922 | [
"MIT"
] | null | null | null | core/imbox/parser.py | chao-lv/ok-mail-helper | 379907d6ba64a82e3dece2f8422130616e616922 | [
"MIT"
] | null | null | null | import imaplib
import re
import email
import base64
import quopri
import sys
import time
from datetime import datetime
from email.header import decode_header
from core.imbox.utils import str_encode, str_decode
import operator as op
import configparser
import os
from email import header
# 获取配置
base_dir = os.path.dirnam... | 35.041667 | 96 | 0.59626 | import imaplib
import re
import email
import base64
import quopri
import sys
import time
from datetime import datetime
from email.header import decode_header
from core.imbox.utils import str_encode, str_decode
import operator as op
import configparser
import os
from email import header
base_dir = os.path.dirname(os.p... | true | true |
f7418eacd919e700ef80bdcfc1283906196b5af8 | 157 | py | Python | practicals/week3-1/problem5.py | armgabrielyan/intro-to-python | 6a2abdab543b36c6412c8d9515d9078b93de7443 | [
"MIT"
] | null | null | null | practicals/week3-1/problem5.py | armgabrielyan/intro-to-python | 6a2abdab543b36c6412c8d9515d9078b93de7443 | [
"MIT"
] | null | null | null | practicals/week3-1/problem5.py | armgabrielyan/intro-to-python | 6a2abdab543b36c6412c8d9515d9078b93de7443 | [
"MIT"
] | null | null | null | correct_num = 5
for _ in range(10):
guess = int(input('Enter guess: '))
if correct_num == guess:
print('That was a good guess!')
break
| 17.444444 | 39 | 0.592357 | correct_num = 5
for _ in range(10):
guess = int(input('Enter guess: '))
if correct_num == guess:
print('That was a good guess!')
break
| true | true |
f7418ec150452ffb2a7205d78f5bd83615cedd39 | 28,485 | py | Python | electrum/plugin.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 4 | 2020-06-27T22:43:34.000Z | 2021-04-12T02:29:30.000Z | electrum/plugin.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 21 | 2020-06-20T15:02:50.000Z | 2021-04-07T10:14:59.000Z | electrum/plugin.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 13 | 2020-06-28T08:13:28.000Z | 2021-12-28T00:11:56.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 39.507628 | 120 | 0.602282 |
import os
import pkgutil
import importlib.util
import time
import threading
import sys
from typing import (NamedTuple, Any, Union, TYPE_CHECKING, Optional, Tuple,
Dict, Iterable, List, Sequence)
import concurrent
from concurrent import futures
from .i18n import _
from .util ... | true | true |
f7418f0b52075a49fb21243f3295f02f023d4821 | 65 | py | Python | faqt/__init__.py | kapoorlab/FAQT | 2f3bc0574a350341988987ca3beb7bcf68203b6c | [
"MIT"
] | null | null | null | faqt/__init__.py | kapoorlab/FAQT | 2f3bc0574a350341988987ca3beb7bcf68203b6c | [
"MIT"
] | null | null | null | faqt/__init__.py | kapoorlab/FAQT | 2f3bc0574a350341988987ca3beb7bcf68203b6c | [
"MIT"
] | null | null | null | from .helpers import *
from .Augmentation2D import Augmentation2D | 32.5 | 42 | 0.846154 | from .helpers import *
from .Augmentation2D import Augmentation2D | true | true |
f7418f389686a44d5933df27fd85ab82723cb54b | 729 | py | Python | test/mitmproxy/addons/test_anticache.py | BitJetKit/mitmproxy | 11d266419c29ca26a4671f8170b0c36c32036389 | [
"MIT"
] | 9 | 2016-11-20T02:18:18.000Z | 2021-07-27T00:25:13.000Z | test/mitmproxy/addons/test_anticache.py | BitJetKit/mitmproxy | 11d266419c29ca26a4671f8170b0c36c32036389 | [
"MIT"
] | 1 | 2021-09-19T06:47:16.000Z | 2021-09-19T06:47:16.000Z | test/mitmproxy/addons/test_anticache.py | BitJetKit/mitmproxy | 11d266419c29ca26a4671f8170b0c36c32036389 | [
"MIT"
] | 15 | 2016-12-22T15:15:47.000Z | 2021-09-19T06:47:02.000Z | from .. import tutils, mastertest
from mitmproxy.addons import anticache
from mitmproxy import master
from mitmproxy import options
from mitmproxy import proxy
class TestAntiCache(mastertest.MasterTest):
def test_simple(self):
o = options.Options(anticache = True)
m = master.Master(o, proxy.DummyS... | 30.375 | 59 | 0.659808 | from .. import tutils, mastertest
from mitmproxy.addons import anticache
from mitmproxy import master
from mitmproxy import options
from mitmproxy import proxy
class TestAntiCache(mastertest.MasterTest):
def test_simple(self):
o = options.Options(anticache = True)
m = master.Master(o, proxy.DummyS... | true | true |
f7419075b49d2cf5e3ff7fbb8c9d41f0e94803a6 | 2,888 | py | Python | sdk/python/pulumi_azure_native/datafactory/get_integration_runtime_status.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/get_integration_runtime_status.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/get_integration_runtime_status.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 34.380952 | 157 | 0.677978 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
__all__ = [
'GetIntegrationRuntimeStatusResult',
'AwaitableGetIntegrationRuntimeStatusResult',
'get_integration_runtime_status',
]
@pu... | true | true |
f741918aa1bab2e76d4efde7ecbc051a5abf7758 | 91 | py | Python | finalproject/finalapp/apps.py | hvncodes/KeepUpToDateProject | dbb4acd5d8341317bacca8642fef0057e89815c3 | [
"MIT"
] | null | null | null | finalproject/finalapp/apps.py | hvncodes/KeepUpToDateProject | dbb4acd5d8341317bacca8642fef0057e89815c3 | [
"MIT"
] | null | null | null | finalproject/finalapp/apps.py | hvncodes/KeepUpToDateProject | dbb4acd5d8341317bacca8642fef0057e89815c3 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FinalappConfig(AppConfig):
name = 'finalapp'
| 15.166667 | 33 | 0.758242 | from django.apps import AppConfig
class FinalappConfig(AppConfig):
name = 'finalapp'
| true | true |
f741920a79ff6d3a12582de50e517a6f3b4afebb | 5,473 | py | Python | vendors/espressif/esp-idf/components/nghttp/nghttp2/gennghttpxfun.py | Yoimer/AFR_ESP32_FreeRTOS_V202007 | 6758176cbceaf4ad6c2b8236d33e4dc302fe3693 | [
"MIT"
] | 43 | 2019-12-03T19:48:53.000Z | 2021-09-05T05:34:53.000Z | vendors/espressif/esp-idf/components/nghttp/nghttp2/gennghttpxfun.py | Yoimer/AFR_ESP32_FreeRTOS_V202007 | 6758176cbceaf4ad6c2b8236d33e4dc302fe3693 | [
"MIT"
] | 59 | 2019-12-04T00:06:45.000Z | 2022-03-30T20:04:03.000Z | vendors/espressif/esp-idf/components/nghttp/nghttp2/gennghttpxfun.py | Yoimer/AFR_ESP32_FreeRTOS_V202007 | 6758176cbceaf4ad6c2b8236d33e4dc302fe3693 | [
"MIT"
] | 20 | 2019-11-29T14:51:04.000Z | 2021-07-10T22:11:16.000Z | #!/usr/bin/env python
from gentokenlookup import gentokenlookup
OPTIONS = [
"private-key-file",
"private-key-passwd-file",
"certificate-file",
"dh-param-file",
"subcert",
"backend",
"frontend",
"workers",
"http2-max-concurrent-streams",
"log-level",
"daemon",
"http2-pro... | 27.228856 | 148 | 0.640599 |
from gentokenlookup import gentokenlookup
OPTIONS = [
"private-key-file",
"private-key-passwd-file",
"certificate-file",
"dh-param-file",
"subcert",
"backend",
"frontend",
"workers",
"http2-max-concurrent-streams",
"log-level",
"daemon",
"http2-proxy",
"http2-bridg... | true | true |
f74193b317305641521ffde1df103bf390b625ff | 655 | py | Python | code/UI/OpenAPI/python-flask-server/KG2/openapi_server/controllers/entity_controller.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | code/UI/OpenAPI/python-flask-server/KG2/openapi_server/controllers/entity_controller.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | code/UI/OpenAPI/python-flask-server/KG2/openapi_server/controllers/entity_controller.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | import connexion
import six
from openapi_server import util
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../../../../../../ARAX/NodeSynonymizer")
from node_synonymizer import NodeSynonymizer
def get_entity(q): # noqa: E501
"""Obtain CURIE and synonym information about a sea... | 24.259259 | 129 | 0.709924 | import connexion
import six
from openapi_server import util
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../../../../../../ARAX/NodeSynonymizer")
from node_synonymizer import NodeSynonymizer
def get_entity(q):
synonymizer = NodeSynonymizer()
response = synonymizer.get_... | true | true |
f741948e48d7e5c923ab69d6cfebad973ce538a4 | 989 | py | Python | app/models/message.py | CubexX/confstat-site | b4bd4eba3d6e745fd64fc935a19e3d6ceaec52f9 | [
"MIT"
] | 1 | 2019-08-30T17:16:53.000Z | 2019-08-30T17:16:53.000Z | app/models/message.py | CubexX/confstat-web | b4bd4eba3d6e745fd64fc935a19e3d6ceaec52f9 | [
"MIT"
] | null | null | null | app/models/message.py | CubexX/confstat-web | b4bd4eba3d6e745fd64fc935a19e3d6ceaec52f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'CubexX'
from datetime import datetime
from app import db
class Message(db.Model):
__table__ = 'messages'
__timestamps__ = False
__fillable__ = ['uid', 'cid', 'date']
@staticmethod
def today_chat_count(cid):
t = datetime.today()
today = int(d... | 29.088235 | 89 | 0.571284 |
__author__ = 'CubexX'
from datetime import datetime
from app import db
class Message(db.Model):
__table__ = 'messages'
__timestamps__ = False
__fillable__ = ['uid', 'cid', 'date']
@staticmethod
def today_chat_count(cid):
t = datetime.today()
today = int(datetime(t.year, t.month... | true | true |
f741954356549c5f87da1f195a9f6b4c293e9802 | 4,603 | py | Python | trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py | shivasiddharth/google-cloud-python | 91ac0aab77a1a17a8837c49b61df2415de60d2a3 | [
"Apache-2.0"
] | null | null | null | trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py | shivasiddharth/google-cloud-python | 91ac0aab77a1a17a8837c49b61df2415de60d2a3 | [
"Apache-2.0"
] | null | null | null | trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py | shivasiddharth/google-cloud-python | 91ac0aab77a1a17a8837c49b61df2415de60d2a3 | [
"Apache-2.0"
] | 1 | 2020-11-15T11:44:36.000Z | 2020-11-15T11:44:36.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 36.824 | 88 | 0.655659 |
import google.api_core.grpc_helpers
from google.cloud.trace_v2.proto import tracing_pb2_grpc
class TraceServiceGrpcTransport(object):
_OAUTH_SCOPES = (
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/trace.append",
)
def __ini... | true | true |
f741956a521284d344ae5a5f1d8f3c486e1dfa2b | 11,649 | py | Python | tests/templates/test_layers/test_particle_conserving_u2.py | rryoung98/pennylane | e17dc373c32530dfb2fdba8d90f584f314e23cc0 | [
"Apache-2.0"
] | 3 | 2021-11-08T11:46:42.000Z | 2021-12-27T10:13:38.000Z | tests/templates/test_layers/test_particle_conserving_u2.py | rryoung98/pennylane | e17dc373c32530dfb2fdba8d90f584f314e23cc0 | [
"Apache-2.0"
] | 2 | 2021-11-09T14:57:09.000Z | 2022-01-12T12:35:58.000Z | artifacts/old_dataset_versions/original_commits_v02/pennylane/pennylane#1243/before/test_particle_conserving_u2.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | 1 | 2021-07-11T11:45:14.000Z | 2021-07-11T11:45:14.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies 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... | 32.268698 | 100 | 0.569062 |
import pytest
import numpy as np
import pennylane as qml
from pennylane import numpy as pnp
class TestDecomposition:
@pytest.mark.parametrize(
"layers, qubits, init_state",
[
(2, 4, np.array([1, 1, 0, 0])),
(1, 6, np.array([1, 1, 0, 0, 0, 0])),
(1,... | true | true |
f74196dee907babf5bf58068f2ed388b6ed72d1c | 3,376 | py | Python | server/db.py | 18alantom/flask_test_movr | cc6a18041b62646b2136425c43d7224922de74ef | [
"MIT"
] | null | null | null | server/db.py | 18alantom/flask_test_movr | cc6a18041b62646b2136425c43d7224922de74ef | [
"MIT"
] | null | null | null | server/db.py | 18alantom/flask_test_movr | cc6a18041b62646b2136425c43d7224922de74ef | [
"MIT"
] | null | null | null | import pymysql.cursors
from dotenv import load_dotenv
from .constants import PROD, LOCN, PRMO, PRLO, report_query, movement_query, required_cols
from .helpers import get_id, get_timestamp, insert_sql
load_dotenv()
class DBConnectionHandler:
def __init__(self, user="root", password="00000000", host="localhost", d... | 38.363636 | 108 | 0.604265 | import pymysql.cursors
from dotenv import load_dotenv
from .constants import PROD, LOCN, PRMO, PRLO, report_query, movement_query, required_cols
from .helpers import get_id, get_timestamp, insert_sql
load_dotenv()
class DBConnectionHandler:
def __init__(self, user="root", password="00000000", host="localhost", d... | true | true |
f741978f61da1e587e29f8bddb33b288a479dd7c | 3,238 | py | Python | sdk/tables/azure-data-tables/samples/sample_query_tables.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2021-04-30T04:44:41.000Z | 2021-04-30T04:44:41.000Z | sdk/tables/azure-data-tables/samples/sample_query_tables.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/tables/azure-data-tables/samples/sample_query_tables.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2019-04-05T18:17:43.000Z | 2019-04-05T18:17:43.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.
# --------------------------------------------------------------------... | 35.977778 | 120 | 0.601915 |
import os
from dotenv import find_dotenv, load_dotenv
class QueryTables(object):
def __init__(self):
load_dotenv(find_dotenv())
self.access_key = os.getenv("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY")
self.endpoint = os.getenv("TABLES_STORAGE_ENDPOINT_SUFFIX")
self.account_name ... | true | true |
f74197c97c3ac7e3fe672f9a70f35b41d66c1252 | 1,423 | py | Python | setup.py | okfde/froide-fax | f5158c5bbee985c943c9d82aadc1d7b506f047aa | [
"MIT"
] | null | null | null | setup.py | okfde/froide-fax | f5158c5bbee985c943c9d82aadc1d7b506f047aa | [
"MIT"
] | 4 | 2018-07-16T13:37:52.000Z | 2021-11-09T09:31:24.000Z | setup.py | okfde/froide-fax | f5158c5bbee985c943c9d82aadc1d7b506f047aa | [
"MIT"
] | 2 | 2019-05-01T12:34:51.000Z | 2021-08-14T00:28:56.000Z | #!/usr/bin/env python
from __future__ import print_function
import os
import re
import codecs
from setuptools import setup, find_packages
def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
def find_vers... | 28.46 | 88 | 0.654252 |
from __future__ import print_function
import os
import re
import codecs
from setuptools import setup, find_packages
def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
def find_version(*file_paths):
... | true | true |
f74197eef84e7c3139dd76d3bb647b1e29702f94 | 788 | py | Python | class5-notebook/6-pandas_creating_series.py | cce-bigdataintro-1160/spring2019 | e55b24bda61bbc87ad39dfec93c68a8f2da77831 | [
"MIT"
] | 1 | 2019-05-04T04:12:17.000Z | 2019-05-04T04:12:17.000Z | class5-notebook/6-pandas_creating_series.py | cce-bigdataintro-1160/spring2019 | e55b24bda61bbc87ad39dfec93c68a8f2da77831 | [
"MIT"
] | null | null | null | class5-notebook/6-pandas_creating_series.py | cce-bigdataintro-1160/spring2019 | e55b24bda61bbc87ad39dfec93c68a8f2da77831 | [
"MIT"
] | 1 | 2020-03-11T02:13:25.000Z | 2020-03-11T02:13:25.000Z | #!/usr/bin/env python3
import numpy as np
import pandas as pd
def pretty_print(name, to_print):
print(f'{name}:')
print(f'{to_print}\n\n')
orders = pd.Series(data=[300.50, 60, 123.40, 60, np.nan],
index=['Customer 1', 'Customer 2', 'Customer 3', 'Customer 4', 'Customer 5'])
pretty_print... | 31.52 | 96 | 0.714467 |
import numpy as np
import pandas as pd
def pretty_print(name, to_print):
print(f'{name}:')
print(f'{to_print}\n\n')
orders = pd.Series(data=[300.50, 60, 123.40, 60, np.nan],
index=['Customer 1', 'Customer 2', 'Customer 3', 'Customer 4', 'Customer 5'])
pretty_print("orders", orders.to_s... | true | true |
f741988afec3dde684057341ee40c25be3833274 | 14,900 | py | Python | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_include.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_include.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_include.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | 1 | 2020-07-26T03:57:45.000Z | 2020-07-26T03:57:45.000Z | import cStringIO
from Ft.Lib.Uri import OsPathToUri
from Ft.Xml.InputSource import InputSourceFactory, DefaultFactory
from Ft.Xml.Xslt import XsltException, Error
from Ft.Xml.Xslt.Processor import Processor
from Xml.Xslt import test_harness
#-----------------------------------------------------------------------
# G... | 35.645933 | 136 | 0.62255 | import cStringIO
from Ft.Lib.Uri import OsPathToUri
from Ft.Xml.InputSource import InputSourceFactory, DefaultFactory
from Ft.Xml.Xslt import XsltException, Error
from Ft.Xml.Xslt.Processor import Processor
from Xml.Xslt import test_harness
sheet_str_1 = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http:... | true | true |
f74198d7fd3b6846060c72872d70e8c07c055776 | 1,517 | py | Python | scripts/bb_scrapper.py | arihant-001/django-cart | ab9a4e01d7ec2065beaf4ccab4b9117a042eade5 | [
"MIT"
] | null | null | null | scripts/bb_scrapper.py | arihant-001/django-cart | ab9a4e01d7ec2065beaf4ccab4b9117a042eade5 | [
"MIT"
] | null | null | null | scripts/bb_scrapper.py | arihant-001/django-cart | ab9a4e01d7ec2065beaf4ccab4b9117a042eade5 | [
"MIT"
] | null | null | null | import requests
import csv
from bs4 import BeautifulSoup
headers = {
'authority': 'scrapeme.live',
'dnt': '1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36',
'accept': 'text/h... | 37.925 | 141 | 0.616348 | import requests
import csv
from bs4 import BeautifulSoup
headers = {
'authority': 'scrapeme.live',
'dnt': '1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36',
'accept': 'text/h... | true | true |
f741993f7be5fb6ce2ec928fdf7de3d897a78836 | 17,704 | py | Python | src/richie/apps/courses/settings/__init__.py | regisb/richie | ddb65907f7ee3d6cf8c72e229b5d07d2e2b97d44 | [
"MIT"
] | 174 | 2018-04-14T23:36:01.000Z | 2022-03-10T09:27:01.000Z | src/richie/apps/courses/settings/__init__.py | EDUlib/richie | 3f9b14b929641f9392e54ba9badbb7a9a9fe7d44 | [
"MIT"
] | 631 | 2018-04-04T11:28:53.000Z | 2022-03-31T11:18:31.000Z | src/richie/apps/courses/settings/__init__.py | EDUlib/richie | 3f9b14b929641f9392e54ba9badbb7a9a9fe7d44 | [
"MIT"
] | 64 | 2018-06-27T08:35:01.000Z | 2022-03-10T09:27:43.000Z | """
Default settings for the Richie courses app.
If you use Django Configuration for your settings, you can use our mixin to import these
default settings:
```
from configurations import Configuration
from richie.apps.courses.settings.mixins import RichieCoursesConfigurationMixin
class MyConfiguration... | 34.919132 | 88 | 0.578739 | from django.utils.translation import gettext_lazy as _
RICHIE_LMS_BACKENDS = []
THUMBNAIL_PROCESSORS = (
"easy_thumbnails.processors.colorspace",
"easy_thumbnails.processors.autocrop",
"filer.thumbnail_processors.scale_and_crop_with_subject_location",
"easy_thumbnails.processors.filters",
"easy_... | true | true |
f7419a01406c0a8c3193b367c3cd8cb69bab1e1f | 7,219 | py | Python | tests/tests/test_component.py | ThibHlln/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | null | null | null | tests/tests/test_component.py | ThibHlln/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | 2 | 2021-12-03T10:49:42.000Z | 2022-03-26T11:24:00.000Z | tests/tests/test_component.py | unifhy-org/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | null | null | null | from importlib import import_module
from datetime import timedelta
import cf
import unifhy
from .test_time import get_dummy_timedomain
from .test_space import (
get_dummy_spacedomain, get_dummy_land_sea_mask_field,
get_dummy_flow_direction_field
)
from .test_data import (
get_dummy_dataset, get_dummy_comp... | 35.043689 | 76 | 0.485801 | from importlib import import_module
from datetime import timedelta
import cf
import unifhy
from .test_time import get_dummy_timedomain
from .test_space import (
get_dummy_spacedomain, get_dummy_land_sea_mask_field,
get_dummy_flow_direction_field
)
from .test_data import (
get_dummy_dataset, get_dummy_comp... | true | true |
f7419a70d7b4cb69cfd0158380503053ff9ffea4 | 415 | py | Python | ledger/address/migrations/0003_remove_useraddress_profile_address.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 5 | 2018-02-12T03:16:36.000Z | 2019-09-07T20:36:37.000Z | ledger/address/migrations/0003_remove_useraddress_profile_address.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 162 | 2018-02-16T05:13:03.000Z | 2021-05-14T02:47:37.000Z | ledger/address/migrations/0003_remove_useraddress_profile_address.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 14 | 2018-02-15T05:22:36.000Z | 2022-02-15T08:24:43.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-06 02:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('address', '0002_useraddress_profile_address'),
]
operations = [
migrations.RemoveFie... | 20.75 | 56 | 0.633735 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('address', '0002_useraddress_profile_address'),
]
operations = [
migrations.RemoveField(
model_name='useraddress',
name='profile_ad... | true | true |
f7419ac8ec8b4890197250eb3933dc125cbae619 | 1,023 | py | Python | structured_network_counting.py | NikolayVaklinov10/Structured_StreamingPS | 62d8a57309ba5c1afa98befcae00aded038e006c | [
"Apache-2.0"
] | null | null | null | structured_network_counting.py | NikolayVaklinov10/Structured_StreamingPS | 62d8a57309ba5c1afa98befcae00aded038e006c | [
"Apache-2.0"
] | null | null | null | structured_network_counting.py | NikolayVaklinov10/Structured_StreamingPS | 62d8a57309ba5c1afa98befcae00aded038e006c | [
"Apache-2.0"
] | null | null | null | import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import explode
from pyspark.sql.functions import split
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: spark-submit structured_network_counting.py <hostname> <port>", file=sys.stderr)
exit(-1)
host = sy... | 23.25 | 102 | 0.55132 | import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import explode
from pyspark.sql.functions import split
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: spark-submit structured_network_counting.py <hostname> <port>", file=sys.stderr)
exit(-1)
host = sy... | true | true |
f7419c0be2490556181967280e59ecbdfcb3bc13 | 779 | py | Python | UDPClient.py | fsikansi/simple-dash-pcars | 2ed5dca891d57cdf905526e1354f66bbe74b227d | [
"MIT"
] | 1 | 2017-07-13T08:19:14.000Z | 2017-07-13T08:19:14.000Z | UDPClient.py | fsikansi/simple-dash-pcars | 2ed5dca891d57cdf905526e1354f66bbe74b227d | [
"MIT"
] | null | null | null | UDPClient.py | fsikansi/simple-dash-pcars | 2ed5dca891d57cdf905526e1354f66bbe74b227d | [
"MIT"
] | null | null | null | import socket
import threading
class UDPClient:
def __init__(self, IPAddress, port):
self.IPAddress = IPAddress
self.port = port
self.buffer_size = 2048
self.client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.last_package = None
def connect(self):
t... | 25.129032 | 78 | 0.580231 | import socket
import threading
class UDPClient:
def __init__(self, IPAddress, port):
self.IPAddress = IPAddress
self.port = port
self.buffer_size = 2048
self.client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.last_package = None
def connect(self):
t... | true | true |
f7419c3de2dca6d0afcb02bc75ba6a31a866e6f9 | 18,667 | py | Python | sqliterepl/completions.py | nl253/SQLiteREPL | 6e35a0528da07edb2f436bcda0e91747ca02b312 | [
"BSD-3-Clause"
] | 13 | 2018-09-03T22:01:49.000Z | 2022-01-07T08:30:39.000Z | sqliterepl/completions.py | nl253/SQLiteREPL | 6e35a0528da07edb2f436bcda0e91747ca02b312 | [
"BSD-3-Clause"
] | 1 | 2018-03-03T13:55:35.000Z | 2018-03-03T16:44:23.000Z | sqliterepl/completions.py | nl253/SQLiteREPL | 6e35a0528da07edb2f436bcda0e91747ca02b312 | [
"BSD-3-Clause"
] | 2 | 2018-03-03T15:25:59.000Z | 2021-06-24T23:42:34.000Z | # Standard Library
from functools import reduce
from glob import iglob
from operator import concat
from os import listdir, getenv
from os.path import expanduser, isdir, isfile
from typing import Dict, Generator, Iterable, List, Set
# 3rd Party
from prompt_toolkit.completion import CompleteEvent, Completer, Completion,... | 31.746599 | 131 | 0.532865 |
from functools import reduce
from glob import iglob
from operator import concat
from os import listdir, getenv
from os.path import expanduser, isdir, isfile
from typing import Dict, Generator, Iterable, List, Set
from prompt_toolkit.completion import CompleteEvent, Completer, Completion, ThreadedCompleter, merge_com... | true | true |
f7419d67a11135cbb766e5c0ce11683630a6b1f0 | 451 | py | Python | main/wsgi.py | umarmughal824/bootcamp-ecommerce | 681bcc788a66867b8f240790c0ed33680b73932b | [
"BSD-3-Clause"
] | 2 | 2018-06-20T19:37:03.000Z | 2021-01-06T09:51:40.000Z | main/wsgi.py | mitodl/bootcamp-ecommerce | ba7d6aefe56c6481ae2a5afc84cdd644538b6d50 | [
"BSD-3-Clause"
] | 1,226 | 2017-02-23T14:52:28.000Z | 2022-03-29T13:19:54.000Z | main/wsgi.py | umarmughal824/bootcamp-ecommerce | 681bcc788a66867b8f240790c0ed33680b73932b | [
"BSD-3-Clause"
] | 3 | 2017-03-20T03:51:27.000Z | 2021-03-19T15:54:31.000Z | """
WSGI config for bandcamp app.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.... | 26.529412 | 78 | 0.784922 | import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
application = Cling(get_wsgi_application())
| true | true |
f7419e086a8678f70afb34290a1a3502d253886c | 5,855 | py | Python | original_code/calibration.py | csherwood-usgs/CoastCam | aa4de7c02ee0d719d89f13409319a44dba5eb768 | [
"CC0-1.0"
] | 3 | 2020-10-16T21:37:24.000Z | 2021-02-01T16:14:44.000Z | original_code/calibration.py | csherwood-usgs/CoastCam | aa4de7c02ee0d719d89f13409319a44dba5eb768 | [
"CC0-1.0"
] | 4 | 2020-10-21T22:26:29.000Z | 2021-04-04T22:54:09.000Z | original_code/calibration.py | csherwood-usgs/CoastCam | aa4de7c02ee0d719d89f13409319a44dba5eb768 | [
"CC0-1.0"
] | 2 | 2020-10-01T00:41:11.000Z | 2020-10-19T17:35:18.000Z | import datetime
from pathlib import Path
import numpy as np
import scipy.io
class CameraCalibration(object):
"""Camera calibration saved in .mat file and method to assemble Projective (P) martrix.
Notes:
- Inspired by example code + notes from CiRC which are derived from Hartley and Zisserman (20030... | 32.893258 | 106 | 0.525021 | import datetime
from pathlib import Path
import numpy as np
import scipy.io
class CameraCalibration(object):
def __init__(self, calibration_file):
calibration_file = Path(calibration_file)
self.fname = calibration_file.name
sn, cn, dc, cs, _ = self.fname.split('_')
self.serial_num... | true | true |
f7419e6a363761ba10d75097338a11b2db5be142 | 21,810 | py | Python | sdk/python/pulumi_oci/autoscaling/_inputs.py | EladGabay/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-08-17T11:14:46.000Z | 2021-12-31T02:07:03.000Z | sdk/python/pulumi_oci/autoscaling/_inputs.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-09-06T11:21:29.000Z | 2021-09-06T11:21:29.000Z | sdk/python/pulumi_oci/autoscaling/_inputs.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-08-24T23:31:30.000Z | 2022-01-02T19:26:54.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 39.0161 | 380 | 0.658872 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'AutoScalingConfigurationAutoScalingResourcesArgs',
'AutoScalingConfigurationPolicyArgs',
'AutoScalingConfigurationPolicyCapacityArgs',
'Aut... | true | true |
f7419e91a401f1972fe2a22d0f490d6051b310c1 | 1,983 | py | Python | tests/meltano/cli/test_ui.py | siilats/meltano | 404605c83f441c3fc2b729e26416c6caa8b0ed0b | [
"MIT"
] | 122 | 2021-06-21T17:30:29.000Z | 2022-03-25T06:21:38.000Z | tests/meltano/cli/test_ui.py | siilats/meltano | 404605c83f441c3fc2b729e26416c6caa8b0ed0b | [
"MIT"
] | null | null | null | tests/meltano/cli/test_ui.py | siilats/meltano | 404605c83f441c3fc2b729e26416c6caa8b0ed0b | [
"MIT"
] | 21 | 2021-06-22T10:08:15.000Z | 2022-03-18T08:57:02.000Z | from unittest import mock
import pytest
from asserts import assert_cli_runner
from meltano.cli import cli
from meltano.core.project_settings_service import (
ProjectSettingsService,
SettingValueStore,
)
from meltano.core.tracking import GoogleAnalyticsTracker
class TestCliUi:
def test_ui(self, project, c... | 33.610169 | 88 | 0.656077 | from unittest import mock
import pytest
from asserts import assert_cli_runner
from meltano.cli import cli
from meltano.core.project_settings_service import (
ProjectSettingsService,
SettingValueStore,
)
from meltano.core.tracking import GoogleAnalyticsTracker
class TestCliUi:
def test_ui(self, project, c... | true | true |
f7419f678f29a3b17f3b81503cbf2078f4432fdd | 770 | py | Python | src/posts/views.py | Sivaraj23/Django | 37b4bf7bf649bc9ae5eaec5d8be527790af76834 | [
"bzip2-1.0.6"
] | null | null | null | src/posts/views.py | Sivaraj23/Django | 37b4bf7bf649bc9ae5eaec5d8be527790af76834 | [
"bzip2-1.0.6"
] | null | null | null | src/posts/views.py | Sivaraj23/Django | 37b4bf7bf649bc9ae5eaec5d8be527790af76834 | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from .models import Post
# Create your views here.
def post_create(request):
return HttpResponse("<h1>Create</h1>")
def post_detail(request, id=None): #retrieve
#instance = Post.objects.get(id=1)
instance = get_object_or_... | 25.666667 | 54 | 0.735065 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from .models import Post
def post_create(request):
return HttpResponse("<h1>Create</h1>")
def post_detail(request, id=None):
instance = get_object_or_404(Post, id=id)
context = {
"title": instance.title,
"instance... | true | true |
f7419fc671986834231d3b93ce9d5799e2ab7948 | 764 | py | Python | tests/shell/test_shell.py | un-def/luamb | eec3969eda1b225e26a138c25720182754e9ec54 | [
"MIT"
] | 16 | 2016-07-20T03:33:45.000Z | 2021-07-23T06:05:00.000Z | tests/shell/test_shell.py | un-def/luamb | eec3969eda1b225e26a138c25720182754e9ec54 | [
"MIT"
] | 2 | 2016-08-20T02:47:26.000Z | 2017-08-29T16:27:42.000Z | tests/shell/test_shell.py | un-def/luamb | eec3969eda1b225e26a138c25720182754e9ec54 | [
"MIT"
] | 1 | 2016-07-20T10:25:55.000Z | 2016-07-20T10:25:55.000Z | import pytest
def test_shellsrc(script_runner):
exit_status = script_runner('')
assert exit_status == 0
assert script_runner.output == ''
@pytest.mark.parametrize('env_name,is_valid', [
('', False),
('.', False),
('..', False),
('foo/bar', False),
('/foo', False),
('foo/', False)... | 24.645161 | 79 | 0.590314 | import pytest
def test_shellsrc(script_runner):
exit_status = script_runner('')
assert exit_status == 0
assert script_runner.output == ''
@pytest.mark.parametrize('env_name,is_valid', [
('', False),
('.', False),
('..', False),
('foo/bar', False),
('/foo', False),
('foo/', False)... | true | true |
f741a0099685fcc3ac4fb2ae60eb784d31b996b2 | 6,750 | py | Python | xbbo/search_algorithm/multi_fidelity/BOHB.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | xbbo/search_algorithm/multi_fidelity/BOHB.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | xbbo/search_algorithm/multi_fidelity/BOHB.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | '''
Reference: https://github.com/automl/DEHB
'''
from typing import List
import numpy as np
# from xbbo.configspace.feature_space import Uniform2Gaussian
from xbbo.search_algorithm.multi_fidelity.hyperband import HB
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from xbbo.core.trials ... | 39.940828 | 91 | 0.562667 |
from typing import List
import numpy as np
from xbbo.search_algorithm.multi_fidelity.hyperband import HB
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from xbbo.core.trials import Trials, Trial
from xbbo.search_algorithm.multi_fidelity.utils.bracket_manager import BasicConfigGenerato... | true | true |
f741a104e81a6825cd62d86a77d56a4894bf6f85 | 669 | py | Python | meiduo_mall/apps/goods/urls.py | MarioKarting/Django_meiduo_project | ef06e70b1ddb6709983ebb644452c980afc29000 | [
"MIT"
] | null | null | null | meiduo_mall/apps/goods/urls.py | MarioKarting/Django_meiduo_project | ef06e70b1ddb6709983ebb644452c980afc29000 | [
"MIT"
] | null | null | null | meiduo_mall/apps/goods/urls.py | MarioKarting/Django_meiduo_project | ef06e70b1ddb6709983ebb644452c980afc29000 | [
"MIT"
] | null | null | null | ## !/usr/bin/env python
# _*_ coding:utf-8 _*_
from django.conf.urls import url
from . import views
urlpatterns = [
# 1. 列表页面 list/(?P<category_id>\d+)/(?P<page_num>\d+)/
url(r'^list/(?P<category_id>\d+)/(?P<page_num>\d+)/$', views.ListView.as_view(), name='list'),
# 2. 热销排行 hot/(?P<category_id... | 29.086957 | 98 | 0.593423 | rls import url
from . import views
urlpatterns = [
url(r'^list/(?P<category_id>\d+)/(?P<page_num>\d+)/$', views.ListView.as_view(), name='list'),
url(r'^hot/(?P<category_id>\d+)/$', views.HotView.as_view(), name='hot'),
url(r'^detail/(?P<sku_id>\d+)/$', views.DetailView.as_view(), name='d... | true | true |
f741a188fda6bef0c338259d1d5661b648d7d929 | 108 | py | Python | route/__init__.py | 0xwhoami/growtopia-chemsynth-router | 08ad29ccd3ec6b36ddb48662f84073102392979f | [
"CC0-1.0"
] | null | null | null | route/__init__.py | 0xwhoami/growtopia-chemsynth-router | 08ad29ccd3ec6b36ddb48662f84073102392979f | [
"CC0-1.0"
] | null | null | null | route/__init__.py | 0xwhoami/growtopia-chemsynth-router | 08ad29ccd3ec6b36ddb48662f84073102392979f | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2020-End_Of_Life
See the file 'LICENSE' for copying permission
"""
| 15.428571 | 45 | 0.712963 | true | true | |
f741a43109d98d7417d9b518105af68457081288 | 2,493 | py | Python | test/test_lsp_diff.py | python-rope/pylsp-rope | 431415560779881b57048dc563802705f7556bca | [
"MIT"
] | 16 | 2021-10-03T07:18:20.000Z | 2022-03-28T00:11:53.000Z | test/test_lsp_diff.py | python-rope/pylsp-rope | 431415560779881b57048dc563802705f7556bca | [
"MIT"
] | 7 | 2021-10-03T06:37:42.000Z | 2021-11-02T17:13:27.000Z | test/test_lsp_diff.py | python-rope/pylsp-rope | 431415560779881b57048dc563802705f7556bca | [
"MIT"
] | null | null | null | from pylsp_rope.lsp_diff import _difflib_ops_to_text_edit_ops, lsp_diff
from test.conftest import create_document
def test_lsp_diff(workspace):
expected = [
{
"range": {
"start": {"line": 2, "character": 0},
"end": {"line": 3, "character": 0},
},
... | 28.988372 | 82 | 0.556759 | from pylsp_rope.lsp_diff import _difflib_ops_to_text_edit_ops, lsp_diff
from test.conftest import create_document
def test_lsp_diff(workspace):
expected = [
{
"range": {
"start": {"line": 2, "character": 0},
"end": {"line": 3, "character": 0},
},
... | true | true |
f741a486e90a4c865b8ac2b22aebad127566d792 | 3,942 | py | Python | interactive_bayesian_optimisation/libs/io.py | fcole90/interactive_bayesian_optimization | a7aabdd22e84e89e4e1a1c13afee2ba13cad2eb5 | [
"MIT"
] | 3 | 2020-05-05T17:09:59.000Z | 2021-06-18T13:58:15.000Z | interactive_bayesian_optimisation/libs/io.py | fcole90/interactive_bayesian_optimisation | a7aabdd22e84e89e4e1a1c13afee2ba13cad2eb5 | [
"MIT"
] | 1 | 2020-05-03T18:34:48.000Z | 2020-05-03T21:12:55.000Z | interactive_bayesian_optimisation/libs/io.py | fcole90/interactive_bayesian_optimization | a7aabdd22e84e89e4e1a1c13afee2ba13cad2eb5 | [
"MIT"
] | null | null | null | """Functions for input/output"""
import os
import logging
from interactive_bayesian_optimisation import config
from interactive_bayesian_optimisation.libs import utils
import numpy as np
from flask import json
import simplejson.errors
import yaml
def get_file_item_max(file_dir, min_val=0):
# Adding -1 to the li... | 40.22449 | 113 | 0.698123 |
import os
import logging
from interactive_bayesian_optimisation import config
from interactive_bayesian_optimisation.libs import utils
import numpy as np
from flask import json
import simplejson.errors
import yaml
def get_file_item_max(file_dir, min_val=0):
file_id_list = [int(session_id.split(".")[0]) for... | true | true |
f741a5a36d0e415fcfa0601ee6fd6c6f4d1c8726 | 3,888 | py | Python | assignment1/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment1/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment1/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
"""
a naive implementation of numerical gradient of f at x
- f should be a function that takes a single argument
- x is the point (numpy array) to evaluate the gradient at
"""
fx = f(x)... | 31.104 | 108 | 0.58179 | import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
fx = f(x)
grad = np.zeros_like(x)
it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite'])
while not it.finished:
ix = it.multi_index
oldval = x[ix]
... | true | true |
f741a5ff6f02ace97afdcef1b4f5a26bf9db8a3c | 12,759 | py | Python | datasetinsights/estimators/deeplab.py | BlairLee/dataset-insights | 892e2ed3a2facf97cfa3a883700830d959a0c49b | [
"Apache-2.0"
] | 1 | 2020-08-11T22:28:28.000Z | 2020-08-11T22:28:28.000Z | datasetinsights/estimators/deeplab.py | BlairLee/dataset-insights | 892e2ed3a2facf97cfa3a883700830d959a0c49b | [
"Apache-2.0"
] | null | null | null | datasetinsights/estimators/deeplab.py | BlairLee/dataset-insights | 892e2ed3a2facf97cfa3a883700830d959a0c49b | [
"Apache-2.0"
] | null | null | null | import copy
import logging
import numpy as np
import torch
import torchvision
from ignite.metrics import Loss
from torchvision import transforms as T
from torchvision.transforms import functional as F
import datasetinsights.constants as const
from datasetinsights.data.datasets import Dataset
from datasetinsights.data... | 33.313316 | 79 | 0.606004 | import copy
import logging
import numpy as np
import torch
import torchvision
from ignite.metrics import Loss
from torchvision import transforms as T
from torchvision.transforms import functional as F
import datasetinsights.constants as const
from datasetinsights.data.datasets import Dataset
from datasetinsights.data... | true | true |
f741a6da1dc169ef03673c6ede80660210fac8d3 | 9,473 | py | Python | redisearch/query.py | alancleary/redisearch-py | ed3da46bc2a17b9060d0480c12954bec270b3d50 | [
"BSD-2-Clause"
] | 153 | 2019-01-29T16:01:41.000Z | 2022-02-04T15:44:38.000Z | redisearch/query.py | alancleary/redisearch-py | ed3da46bc2a17b9060d0480c12954bec270b3d50 | [
"BSD-2-Clause"
] | 132 | 2019-02-07T08:22:42.000Z | 2022-02-19T03:09:17.000Z | redisearch/query.py | alancleary/redisearch-py | ed3da46bc2a17b9060d0480c12954bec270b3d50 | [
"BSD-2-Clause"
] | 51 | 2019-03-28T08:18:11.000Z | 2021-12-11T15:57:44.000Z | import six
class Query(object):
"""
Query is used to build complex queries that have more parameters than just the query string.
The query string is set in the constructor, and other options have setter functions.
The setter functions return the query object, so they can be chained,
i.e. `Query("f... | 28.881098 | 120 | 0.57912 | import six
class Query(object):
def __init__(self, query_string):
self._query_string = query_string
self._offset = 0
self._num = 10
self._no_content = False
self._no_stopwords = False
self._fields = None
self._verbatim = False
self._with_payloads = ... | true | true |
f741a70aa069da5dc02c4ac0cec42a832304b996 | 4,814 | py | Python | accounts/migrations/0001_initial.py | FeiChaiCom/django-netdisk | f9ef4f46a065527f0ace0a65f2b3210d1657b80f | [
"MIT"
] | 6 | 2021-05-22T12:23:29.000Z | 2022-01-01T01:38:29.000Z | accounts/migrations/0001_initial.py | gaomugong/django-netdisk | 5b2204f5087579bb6a26c6b92972a9f53bd05a7c | [
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | gaomugong/django-netdisk | 5b2204f5087579bb6a26c6b92972a9f53bd05a7c | [
"MIT"
] | 1 | 2021-05-22T15:25:33.000Z | 2021-05-22T15:25:33.000Z | # Generated by Django 2.2.18 on 2021-03-21 15:42
import django.contrib.auth.models
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operation... | 46.737864 | 138 | 0.495222 |
import django.contrib.auth.models
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
... | true | true |
f741a74b306a1cb2f96c9869f81b8c615ff69ca6 | 78 | py | Python | pysal/model/__init__.py | sugam45/pysal | 329a37906bf4f5f837de63f169883bdd671cdbda | [
"BSD-3-Clause"
] | null | null | null | pysal/model/__init__.py | sugam45/pysal | 329a37906bf4f5f837de63f169883bdd671cdbda | [
"BSD-3-Clause"
] | null | null | null | pysal/model/__init__.py | sugam45/pysal | 329a37906bf4f5f837de63f169883bdd671cdbda | [
"BSD-3-Clause"
] | null | null | null | import mgwr
import spglm
import spint
import spreg
import spvcm
import tobler
| 11.142857 | 13 | 0.846154 | import mgwr
import spglm
import spint
import spreg
import spvcm
import tobler
| true | true |
f741a75eacd8ca66ccc4d552a6f9f9f185ae93d2 | 1,800 | py | Python | qiskit/extensions/standard/ry.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | 1 | 2020-09-03T12:28:44.000Z | 2020-09-03T12:28:44.000Z | qiskit/extensions/standard/ry.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | qiskit/extensions/standard/ry.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=invalid-name
"""
Rotation around the y-axis.
"""
from qiskit.circuit import Gate
from qiskit.circuit impor... | 27.272727 | 78 | 0.642222 |
from qiskit.circuit import Gate
from qiskit.circuit import QuantumCircuit
from qiskit.circuit import QuantumRegister
from qiskit.circuit.decorators import _1q_gate
from qiskit.dagcircuit import DAGCircuit
from qiskit.extensions.standard import header
from qiskit.extensions.standard.u3 import U3Gate
class R... | true | true |
f741a815e5c437a72d4e4468bf4a271ae7700cb5 | 1,900 | py | Python | src/agent/k8s-rest-agent/src/server/urls.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 865 | 2017-01-12T21:51:37.000Z | 2022-03-26T16:39:16.000Z | src/agent/k8s-rest-agent/src/server/urls.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 226 | 2017-02-06T08:36:24.000Z | 2022-03-30T06:13:46.000Z | src/agent/k8s-rest-agent/src/server/urls.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 506 | 2017-02-08T06:11:18.000Z | 2022-03-10T04:25:25.000Z | """server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 27.142857 | 77 | 0.678947 | import os
from api.routes.hello.views import HelloViewSet
from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from rest_framework.routers import DefaultRout... | true | true |
f741a8fff3e811cae69217d8b937de65faa70eda | 286 | py | Python | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssetMaintenanceTeam(Document):
pass
| 26 | 68 | 0.786713 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AssetMaintenanceTeam(Document):
pass
| true | true |
f741ae49069944f2f734580177743d11ba78e385 | 770 | py | Python | CursoemVideo/Desafio043.py | davihonorato/Curso-python | 47e6b4b2f5b37ef520b8b31d37dba0b5d259a0b0 | [
"MIT"
] | null | null | null | CursoemVideo/Desafio043.py | davihonorato/Curso-python | 47e6b4b2f5b37ef520b8b31d37dba0b5d259a0b0 | [
"MIT"
] | null | null | null | CursoemVideo/Desafio043.py | davihonorato/Curso-python | 47e6b4b2f5b37ef520b8b31d37dba0b5d259a0b0 | [
"MIT"
] | null | null | null | # Desenvolva uma lógica que leia o peso e a altura de uma pessoa, calcule seu IMC e mostre seu status , de acordo com a tabela abaixo;
# abaixo de 18.5: ABAIXO DO PESO; entre 18.5 e 25: PESO IDEAL; 25 até 30: SOBREPESO; 30 até 40: OBESIDADE; acima de 40: OBESIDADE MÓRBIDA;
peso = float(input('Digite o seu peso: '))
al... | 35 | 138 | 0.637662 |
peso = float(input('Digite o seu peso: '))
altura = float(input('Digite a sua altura: '))
imc = peso/altura**2
if imc < 18.5:
print('ABAIXO DO PESO')
print(f'IMC: {imc:.2f}')
elif imc >= 18.5 and imc < 25:
print('PESO IDEAL')
print(f'IMC: {imc:.2f}')
elif imc >= 25 and imc < 30:
print('SOBREPESO... | true | true |
f741af12161393764acd2f025b501543d118bd84 | 1,578 | py | Python | tests/algorithms/image/filter/test_index_of_dispersion.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-10T17:28:16.000Z | 2021-12-10T17:28:16.000Z | tests/algorithms/image/filter/test_index_of_dispersion.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | null | null | null | tests/algorithms/image/filter/test_index_of_dispersion.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-07T12:39:04.000Z | 2021-12-07T12:39:04.000Z | from __future__ import annotations
import random
import pytest
def test():
from scitbx.array_family import flex
from dials.algorithms.image.filter import index_of_dispersion_filter
# Create an image
image = flex.random_double(2000 * 2000)
image.reshape(flex.grid(2000, 2000))
mask = flex.ra... | 31.56 | 84 | 0.602028 | from __future__ import annotations
import random
import pytest
def test():
from scitbx.array_family import flex
from dials.algorithms.image.filter import index_of_dispersion_filter
image = flex.random_double(2000 * 2000)
image.reshape(flex.grid(2000, 2000))
mask = flex.random_bool(2000 * ... | true | true |
f741b08bcd0e8501ed6e7827399f3aa97eed0f80 | 5,571 | py | Python | waveform_analysis/_common.py | pirun/waveform_analysis | 66809614b1fc985e694af1720341035316a5ac8e | [
"MIT"
] | 125 | 2017-08-27T01:48:02.000Z | 2022-01-20T10:47:13.000Z | waveform_analysis/_common.py | pirun/waveform_analysis | 66809614b1fc985e694af1720341035316a5ac8e | [
"MIT"
] | 13 | 2017-06-25T14:57:43.000Z | 2022-03-18T19:54:19.000Z | waveform_analysis/_common.py | pirun/waveform_analysis | 66809614b1fc985e694af1720341035316a5ac8e | [
"MIT"
] | 48 | 2017-06-25T10:42:10.000Z | 2022-03-09T18:13:55.000Z | #!/usr/bin/env python
from numpy import array_equal, polyfit, sqrt, mean, absolute, log10, arange
import numpy as np
from scipy.stats import gmean
try:
from soundfile import SoundFile
wav_loader = 'pysoundfile'
except:
try:
from scikits.audiolab import Sndfile
wav_loader = 'scikits.audiola... | 29.951613 | 79 | 0.60061 |
from numpy import array_equal, polyfit, sqrt, mean, absolute, log10, arange
import numpy as np
from scipy.stats import gmean
try:
from soundfile import SoundFile
wav_loader = 'pysoundfile'
except:
try:
from scikits.audiolab import Sndfile
wav_loader = 'scikits.audiolab'
except:
... | true | true |
f741b0ffe31275148ee7713e9589e1aad2776b40 | 2,131 | py | Python | avionix/testing/helpers.py | muthukswamy/avionix | 4463328d8520a10cdcb609805e512f5a9f90ad52 | [
"BSD-3-Clause"
] | null | null | null | avionix/testing/helpers.py | muthukswamy/avionix | 4463328d8520a10cdcb609805e512f5a9f90ad52 | [
"BSD-3-Clause"
] | null | null | null | avionix/testing/helpers.py | muthukswamy/avionix | 4463328d8520a10cdcb609805e512f5a9f90ad52 | [
"BSD-3-Clause"
] | null | null | null | import re
from subprocess import CalledProcessError
from typing import Any, List, Optional, Tuple
from avionix._process_utils import custom_check_output
def _space_split(output_line: str):
return [
value
for value in re.split(r"(\t| +)", output_line)
if not re.match(r"^\s*$", value)
... | 29.597222 | 84 | 0.627405 | import re
from subprocess import CalledProcessError
from typing import Any, List, Optional, Tuple
from avionix._process_utils import custom_check_output
def _space_split(output_line: str):
return [
value
for value in re.split(r"(\t| +)", output_line)
if not re.match(r"^\s*$", value)
... | true | true |
f741b126d4d0a11bcd1c782c04432ecf12ee3d96 | 2,519 | py | Python | Proyecto1/venv/Lib/site-packages/telegram/dice.py | RicardoVinicioJara/LugaresTusisticos | d92264231c471cecbc17a2279bedb3779424147c | [
"CC-BY-3.0"
] | 1 | 2021-12-27T21:37:04.000Z | 2021-12-27T21:37:04.000Z | Proyecto1/venv/Lib/site-packages/telegram/dice.py | RicardoVinicioJara/LugaresTusisticos | d92264231c471cecbc17a2279bedb3779424147c | [
"CC-BY-3.0"
] | null | null | null | Proyecto1/venv/Lib/site-packages/telegram/dice.py | RicardoVinicioJara/LugaresTusisticos | d92264231c471cecbc17a2279bedb3779424147c | [
"CC-BY-3.0"
] | 1 | 2021-05-23T18:37:37.000Z | 2021-05-23T18:37:37.000Z | #!/usr/bin/env python
# pylint: disable=R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2020
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public L... | 37.597015 | 98 | 0.667328 |
from telegram import TelegramObject
class Dice(TelegramObject):
def __init__(self, value, emoji, **kwargs):
self.value = value
self.emoji = emoji
@classmethod
def de_json(cls, data, bot):
if not data:
return None
return cls(**data)
DICE... | true | true |
f741b19a862036a25420498abb6c38930096315b | 9,213 | py | Python | src/infi/pyutils/lazy.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 1 | 2022-02-12T20:30:55.000Z | 2022-02-12T20:30:55.000Z | src/infi/pyutils/lazy.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 5 | 2015-11-08T14:50:42.000Z | 2020-06-23T14:42:33.000Z | src/infi/pyutils/lazy.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-02-22T09:06:59.000Z | 2022-02-12T20:30:55.000Z | # Adapted from http://wiki.python.org/moin/PythonDecoratorLibrary#Cached_Properties
import itertools
import time
from .decorators import wraps
from .python_compat import iteritems
from logging import getLogger
from types import MethodType, FunctionType
logger = getLogger(__name__)
class cached_property(object):
"... | 36.41502 | 127 | 0.635189 | import time
from .decorators import wraps
from .python_compat import iteritems
from logging import getLogger
from types import MethodType, FunctionType
logger = getLogger(__name__)
class cached_property(object):
def __init__(self, fget, doc=None):
super(cached_property, self).__init__()
self.fget ... | true | true |
f741b267946788d36428513037138bc95698c844 | 5,606 | py | Python | hw1_release/filters.py | luxufan/CS131_release | e8a92582cfffee3ba6bb43f757bcb520785b6f04 | [
"MIT"
] | null | null | null | hw1_release/filters.py | luxufan/CS131_release | e8a92582cfffee3ba6bb43f757bcb520785b6f04 | [
"MIT"
] | null | null | null | hw1_release/filters.py | luxufan/CS131_release | e8a92582cfffee3ba6bb43f757bcb520785b6f04 | [
"MIT"
] | 2 | 2019-10-08T02:49:26.000Z | 2019-11-10T01:44:42.000Z | """
CS131 - Computer Vision: Foundations and Applications
Assignment 1
Author: Donsuk Lee (donlee90@stanford.edu)
Date created: 07/2017
Last modified: 10/16/2017
Python Version: 3.5+
"""
import numpy as np
def conv_nested(image, kernel):
"""A naive implementation of convolution filter.
This is a naive imple... | 27.082126 | 110 | 0.57492 |
import numpy as np
def conv_nested(image, kernel):
Hi, Wi = image.shape
Hk, Wk = kernel.shape
out = np.zeros((Hi, Wi))
for j in range(Wi):
sum = 0
for ii in range(-(Hk//2), Hk//2 + 1):
for jj in range(-(Wk//2), Wk//2 + 1):
sum += image[i - ... | true | true |
f741b3b043c4ab9fde26389ac48c26c57142a16d | 3,671 | py | Python | tests/packages/run_all.py | kamgha/Nuitka | c4a71f0233dd29e3799c474ccda1d5474d725f20 | [
"Apache-2.0"
] | null | null | null | tests/packages/run_all.py | kamgha/Nuitka | c4a71f0233dd29e3799c474ccda1d5474d725f20 | [
"Apache-2.0"
] | null | null | null | tests/packages/run_all.py | kamgha/Nuitka | c4a71f0233dd29e3799c474ccda1d5474d725f20 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# ... | 29.604839 | 87 | 0.590302 |
# indicated.
#
# 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 t... | true | true |
f741b4b55312954b9aa3047d2cca5788fc30e368 | 83 | py | Python | src/pyasys/contrib/__init__.py | heewoonkim2020/pyasys | ee0e55bbfe1956c7f3cba4c0384b2c6e770658cb | [
"MIT"
] | null | null | null | src/pyasys/contrib/__init__.py | heewoonkim2020/pyasys | ee0e55bbfe1956c7f3cba4c0384b2c6e770658cb | [
"MIT"
] | null | null | null | src/pyasys/contrib/__init__.py | heewoonkim2020/pyasys | ee0e55bbfe1956c7f3cba4c0384b2c6e770658cb | [
"MIT"
] | null | null | null | """
Contrib-util features for Pyasys.
Recommended for advanced developing uses.
""" | 20.75 | 41 | 0.771084 | true | true | |
f741b508a982c997e9cd2785c856edfe094c3c07 | 67,319 | py | Python | src/TulsiGenerator/Scripts/bazel_build.py | maxwellE/tulsi | 2dd98fe970381c67a1fd14df60f9f4fd988505d8 | [
"Apache-2.0"
] | null | null | null | src/TulsiGenerator/Scripts/bazel_build.py | maxwellE/tulsi | 2dd98fe970381c67a1fd14df60f9f4fd988505d8 | [
"Apache-2.0"
] | null | null | null | src/TulsiGenerator/Scripts/bazel_build.py | maxwellE/tulsi | 2dd98fe970381c67a1fd14df60f9f4fd988505d8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2016 The Tulsi 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/LICE... | 38.512014 | 80 | 0.65815 |
import atexit
import errno
import fcntl
import hashlib
import inspect
import io
import json
import os
import pipes
import re
import shutil
import signal
import subprocess
import sys
import textwrap
import threading
import time
import zipfile
from apfs_clone_copy import CopyOnWrite
import bazel_build_e... | true | true |
f741b51c8313efd31142306b169695b563c5f2ab | 1,369 | py | Python | delfiSpec/specproc.py | aaryapatil/specdims | acfc644aa06b13c8b34cde984e207b42e948af41 | [
"MIT"
] | 4 | 2021-09-23T12:08:14.000Z | 2022-03-25T05:20:58.000Z | delfiSpec/specproc.py | aaryapatil/specdims | acfc644aa06b13c8b34cde984e207b42e948af41 | [
"MIT"
] | null | null | null | delfiSpec/specproc.py | aaryapatil/specdims | acfc644aa06b13c8b34cde984e207b42e948af41 | [
"MIT"
] | null | null | null | # Import dependencies
import numpy as np
from apogee.spec import continuum
from apogee.tools import bitmask as bm
from .util import get_DR_slice, bitsNotSet
# Future: Define a class for spectra - spectra, error and weight
def process_spectra(spectra_info=None, badcombpixmask=4351, minSNR=50.):
cont_cannon = cont... | 34.225 | 86 | 0.680789 |
import numpy as np
from apogee.spec import continuum
from apogee.tools import bitmask as bm
from .util import get_DR_slice, bitsNotSet
def process_spectra(spectra_info=None, badcombpixmask=4351, minSNR=50.):
cont_cannon = continuum.fit(spectra_info[:, 0], spectra_info[:, 1], type='cannon')
spectra_info[:,... | true | true |
f741b56dcc418f4b0194578b3d02784e86a53fe0 | 623 | py | Python | imagepy/tools/Measure/setting_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Measure/setting_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Measure/setting_tol.py | Pad0y/imagepy | 23f41b64ade02f94b566b0d23a4b6459c1a1578d | [
"BSD-4-Clause"
] | null | null | null | from sciapp.action import Measure
from sciapp.action import Free
from imagepy.app import ConfigManager
class Plugin(Free):
title = "Measure Setting"
para = Measure.default.copy()
view = [
("color", "color", "line", "color"),
("color", "fcolor", "face", "color"),
("color", "tcolor",... | 28.318182 | 50 | 0.540931 | from sciapp.action import Measure
from sciapp.action import Free
from imagepy.app import ConfigManager
class Plugin(Free):
title = "Measure Setting"
para = Measure.default.copy()
view = [
("color", "color", "line", "color"),
("color", "fcolor", "face", "color"),
("color", "tcolor",... | true | true |
f741b6c629c2aa47e414eb1f19acccbee739587e | 33,134 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | 40 | 2020-07-11T10:07:51.000Z | 2021-12-11T17:09:20.000Z | OpenGLWrapper_JE/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | 18 | 2020-07-20T18:54:31.000Z | 2021-11-04T13:14:28.000Z | OpenGLWrapper_JE/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | 37 | 2020-07-09T23:12:30.000Z | 2022-03-16T11:15:58.000Z | """
SecureTranport support for urllib3 via ctypes.
This makes platform-native TLS available to urllib3 users on macOS without the
use of a compiler. This is an important feature because the Python Package
Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL
that ships with macOS is not c... | 38.527907 | 87 | 0.643146 | from __future__ import absolute_import
import contextlib
import ctypes
import errno
import os.path
import shutil
import socket
import ssl
import threading
import weakref
from .. import util
from ._securetransport.bindings import Security, SecurityConst, CoreFoundation
from ._securetransport.low_level im... | true | true |
f741b77bbffd0226b1db8bc25f06b2a26cd0e1fa | 1,556 | py | Python | repos/system_upgrade/common/actors/dnftransactioncheck/actor.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/common/actors/dnftransactioncheck/actor.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | 1 | 2022-03-07T15:34:11.000Z | 2022-03-07T15:35:15.000Z | repos/system_upgrade/common/actors/dnftransactioncheck/actor.py | tmds/leapp-repository | 7c9ea115a68530eb25f5c23d3fcadd60c501bf78 | [
"Apache-2.0"
] | null | null | null | from leapp.actors import Actor
from leapp.libraries.common import dnfplugin
from leapp.models import (
DNFPluginTask,
DNFWorkaround,
FilteredRpmTransactionTasks,
StorageInfo,
TargetUserSpaceInfo,
UsedTargetRepositories,
XFSPresence
)
from leapp.tags import IPUWorkflowTag, TargetTransactionCh... | 33.826087 | 118 | 0.71401 | from leapp.actors import Actor
from leapp.libraries.common import dnfplugin
from leapp.models import (
DNFPluginTask,
DNFWorkaround,
FilteredRpmTransactionTasks,
StorageInfo,
TargetUserSpaceInfo,
UsedTargetRepositories,
XFSPresence
)
from leapp.tags import IPUWorkflowTag, TargetTransactionCh... | true | true |
f741b8d3d82d7006295eb1647ddbe060ec5bc2fe | 770 | py | Python | tir/technologies/core/enumerations.py | vinicius-fragazi/tir | 756faa19902ae4d19b6cb3df663beda9512c07bb | [
"MIT"
] | 55 | 2018-09-12T22:01:42.000Z | 2022-01-27T19:16:56.000Z | tir/technologies/core/enumerations.py | vinicius-fragazi/tir | 756faa19902ae4d19b6cb3df663beda9512c07bb | [
"MIT"
] | 44 | 2018-09-17T13:50:42.000Z | 2021-08-31T17:54:32.000Z | tir/technologies/core/enumerations.py | vinicius-fragazi/tir | 756faa19902ae4d19b6cb3df663beda9512c07bb | [
"MIT"
] | 55 | 2018-09-13T01:44:42.000Z | 2022-03-08T21:37:35.000Z | from enum import Enum
class MessageType(Enum):
'''
Enumeration that represents the standard messages that are emitted inside log file.
CORRECT = 1
INCORRECT = 2
DISABLED = 3
ASSERTERROR = 4
'''
CORRECT = 1
INCORRECT = 2
DISABLED = 3
ASSERTERROR = 4
class ScrapType(Enum)... | 14.807692 | 87 | 0.587013 | from enum import Enum
class MessageType(Enum):
CORRECT = 1
INCORRECT = 2
DISABLED = 3
ASSERTERROR = 4
class ScrapType(Enum):
TEXT = 1
CSS_SELECTOR = 2
MIXED = 3
SCRIPT = 4
XPATH = 5
class ClickType(Enum):
JS = 1
SELENIUM = 2
ACTIONCHAINS = 3 | true | true |
f741b95a8a2d44685ea6d1e73162967adf5bd58a | 12,370 | py | Python | exp_gqa/main.py | yhCyan/graph-tensor-propagation | b216fb24c5b9ea21d7b338ac24b272b0f346fcc3 | [
"BSD-2-Clause"
] | null | null | null | exp_gqa/main.py | yhCyan/graph-tensor-propagation | b216fb24c5b9ea21d7b338ac24b272b0f346fcc3 | [
"BSD-2-Clause"
] | null | null | null | exp_gqa/main.py | yhCyan/graph-tensor-propagation | b216fb24c5b9ea21d7b338ac24b272b0f346fcc3 | [
"BSD-2-Clause"
] | null | null | null | import os
import json
import torch
import sys
import time
import random
import numpy as np
from tqdm import tqdm, trange
import torch.multiprocessing as mp
import torch.distributed as dist
from torch.utils.tensorboard import SummaryWriter
from apex.parallel import DistributedDataParallel as DDP
from apex import amp
s... | 39.022082 | 139 | 0.636459 | import os
import json
import torch
import sys
import time
import random
import numpy as np
from tqdm import tqdm, trange
import torch.multiprocessing as mp
import torch.distributed as dist
from torch.utils.tensorboard import SummaryWriter
from apex.parallel import DistributedDataParallel as DDP
from apex import amp
s... | true | true |
f741ba1a1add4c5de884efb90b81ee7dc7817ee1 | 917 | py | Python | scripts/missing_taskinstance.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 12 | 2018-01-30T00:44:06.000Z | 2020-07-13T05:20:48.000Z | scripts/missing_taskinstance.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 36 | 2018-03-06T17:49:50.000Z | 2020-06-23T19:26:00.000Z | scripts/missing_taskinstance.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 3 | 2018-08-03T07:03:09.000Z | 2020-07-09T20:21:10.000Z | import os
import re
import unicodedata
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "systori.settings")
import django
django.setup()
from systori.apps.company.models import Company
from systori.apps.task.models import *
from systori.apps.project.models import *
c = Company.objects.get(schema=input("Company Schem... | 33.962963 | 83 | 0.656489 | import os
import re
import unicodedata
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "systori.settings")
import django
django.setup()
from systori.apps.company.models import Company
from systori.apps.task.models import *
from systori.apps.project.models import *
c = Company.objects.get(schema=input("Company Schem... | true | true |
f741ba7f0a2829bac8e4b22d573b6361e8027928 | 3,247 | py | Python | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_transportation_license_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_transportation_license_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_transportation_license_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RecognizeTransportationLicenseResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.734513 | 89 | 0.583 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RecognizeTransportationLicenseResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'result': 'TransportationLicenseResult'
}... | true | true |
f741ba8c9fc0ecb9fb8440bce77b98a81245f12f | 7,752 | py | Python | packages/cli/odahuflow/cli/parsers/toolchain_integration.py | odahu/odahuflow | 58c3220a266a61bb893cf79c4b994569e3445097 | [
"ECL-2.0",
"Apache-2.0"
] | 12 | 2020-10-13T15:39:52.000Z | 2021-10-11T17:13:42.000Z | packages/cli/odahuflow/cli/parsers/toolchain_integration.py | odahu/odahuflow | 58c3220a266a61bb893cf79c4b994569e3445097 | [
"ECL-2.0",
"Apache-2.0"
] | 475 | 2019-11-18T12:40:47.000Z | 2022-03-29T21:17:38.000Z | packages/cli/odahuflow/cli/parsers/toolchain_integration.py | odahu/odahuflow | 58c3220a266a61bb893cf79c4b994569e3445097 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-02-25T11:26:10.000Z | 2021-03-10T12:01:00.000Z | #
# Copyright 2019 EPAM Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 45.069767 | 116 | 0.739164 |
import http
import click
from odahuflow.cli.utils import click_utils
from odahuflow.cli.utils.click_utils import auth_options
from odahuflow.cli.utils.client import pass_obj
from odahuflow.cli.utils.error_handler import IGNORE_NOT_FOUND_ERROR_MESSAGE, \
check_id_or_file_params_present
from odahuflo... | true | true |
f741bc507147e60f884db547bc2173ea30e6ce0c | 3,260 | py | Python | mycity/mycity/test/unit_tests/test_gis_utils.py | EndyPremier/voiceapp311 | 168cf1665bd9a294823f82373e65c6c1d22b8831 | [
"MIT"
] | 46 | 2017-09-23T15:40:10.000Z | 2021-03-08T21:51:48.000Z | mycity/mycity/test/unit_tests/test_gis_utils.py | EndyPremier/voiceapp311 | 168cf1665bd9a294823f82373e65c6c1d22b8831 | [
"MIT"
] | 243 | 2017-10-04T01:04:41.000Z | 2022-03-20T16:19:24.000Z | mycity/mycity/test/unit_tests/test_gis_utils.py | EndyPremier/voiceapp311 | 168cf1665bd9a294823f82373e65c6c1d22b8831 | [
"MIT"
] | 53 | 2017-09-23T15:41:27.000Z | 2020-12-17T22:43:45.000Z | import unittest.mock as mock
import mycity.test.test_constants as test_constants
import mycity.test.unit_tests.base as base
import mycity.utilities.gis_utils as gis_utils
class GISUtilitiesTestCase(base.BaseTestCase):
def test_get_dest_addresses_from_features(self):
to_test = \
gis_utils._get... | 45.277778 | 84 | 0.553067 | import unittest.mock as mock
import mycity.test.test_constants as test_constants
import mycity.test.unit_tests.base as base
import mycity.utilities.gis_utils as gis_utils
class GISUtilitiesTestCase(base.BaseTestCase):
def test_get_dest_addresses_from_features(self):
to_test = \
gis_utils._get... | true | true |
f741bd38463f30a956b3a245afa7f64dd9c129ec | 2,941 | py | Python | src/imageboard/models/post.py | hohner36/hexchan-engine | 8edf155e8fe64936dfe428a6e9bac69705934b1f | [
"MIT"
] | 2 | 2021-04-16T10:11:18.000Z | 2022-03-15T15:16:14.000Z | src/imageboard/models/post.py | hohner36/hexchan-engine | 8edf155e8fe64936dfe428a6e9bac69705934b1f | [
"MIT"
] | 2 | 2019-09-02T19:12:07.000Z | 2019-11-05T22:32:04.000Z | src/imageboard/models/post.py | hohner36/hexchan-engine | 8edf155e8fe64936dfe428a6e9bac69705934b1f | [
"MIT"
] | 2 | 2019-09-02T18:37:25.000Z | 2022-02-20T19:19:40.000Z | from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from hexchan import config
class Post(models.Model):
hid = models.IntegerField(
_('HID'),
editable=False,
db_index=True
)
thread = ... | 20.711268 | 86 | 0.558313 | from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from hexchan import config
class Post(models.Model):
hid = models.IntegerField(
_('HID'),
editable=False,
db_index=True
)
thread = ... | true | true |
f741be91a7087d8b4ddb92b7c0f6ea43266efdf4 | 187 | py | Python | thirvusoft/thirvusoft/doctype/ts_payroll/ts_payroll.py | SaraneshThirvu/Script_Report | 5af8f4d3dc32ead2b124f10c55040d49a21ebb5d | [
"MIT"
] | null | null | null | thirvusoft/thirvusoft/doctype/ts_payroll/ts_payroll.py | SaraneshThirvu/Script_Report | 5af8f4d3dc32ead2b124f10c55040d49a21ebb5d | [
"MIT"
] | null | null | null | thirvusoft/thirvusoft/doctype/ts_payroll/ts_payroll.py | SaraneshThirvu/Script_Report | 5af8f4d3dc32ead2b124f10c55040d49a21ebb5d | [
"MIT"
] | null | null | null | # Copyright (c) 2021, TS and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class TS_Payroll(Document):
pass
| 20.777778 | 49 | 0.786096 |
from frappe.model.document import Document
class TS_Payroll(Document):
pass
| true | true |
f741bf18e2b60aca3fb332c536962bd016be881a | 2,867 | py | Python | testing/trigger_scripts/base_test_triggerer_unittest.py | Ron423c/chromium | 2edf7b980065b648f8b2a6e52193d83832fe36b7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-12-22T05:48:31.000Z | 2022-02-08T19:49:49.000Z | testing/trigger_scripts/base_test_triggerer_unittest.py | Ron423c/chromium | 2edf7b980065b648f8b2a6e52193d83832fe36b7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 4 | 2020-05-22T18:36:43.000Z | 2021-05-19T10:20:23.000Z | extensions/testing/trigger_scripts/base_test_triggerer_unittest.py | blockspacer/chromium_base_conan | b4749433cf34f54d2edff52e2f0465fec8cb9bad | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-12-06T11:48:16.000Z | 2021-09-16T04:44:47.000Z | #!/usr/bin/env vpython
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for base_device_trigger.py."""
import argparse
import json
import unittest
import mock
from pyfakefs import fake_filesyste... | 29.864583 | 77 | 0.599581 |
import argparse
import json
import unittest
import mock
from pyfakefs import fake_filesystem_unittest
import base_test_triggerer
class UnitTest(fake_filesystem_unittest.TestCase):
def setUp(self):
self.setUpPyfakefs()
def test_convert_to_go_swarming_args(self):
args = [
'--swarming', 'x.... | true | true |
f741bf5b1ab789f3f69dba4394b6c567b8432545 | 59 | py | Python | src/neuralkg/utils/__init__.py | zjukg/NeuralKG | 9fe97c29496ed08bc72c76e4dd71e72cbfbe5afa | [
"Apache-2.0"
] | 52 | 2022-01-19T09:08:07.000Z | 2022-03-31T07:02:17.000Z | src/neuralkg/utils/__init__.py | zjukg/NeuralKG | 9fe97c29496ed08bc72c76e4dd71e72cbfbe5afa | [
"Apache-2.0"
] | 2 | 2022-03-08T20:47:38.000Z | 2022-03-18T09:52:33.000Z | src/neuralkg/utils/__init__.py | zjukg/NeuralKG | 9fe97c29496ed08bc72c76e4dd71e72cbfbe5afa | [
"Apache-2.0"
] | 10 | 2022-02-28T07:54:14.000Z | 2022-03-23T14:06:33.000Z | from .setup_parser import setup_parser
from .tools import * | 29.5 | 38 | 0.830508 | from .setup_parser import setup_parser
from .tools import * | true | true |
f741bf641d959301c7d3beb9f3df745811545195 | 2,288 | py | Python | task3_doc2vec_svm.py | tomelf/cnit-623 | edf25f0b216b2480f7b651d3b94c1377dff721c0 | [
"MIT"
] | 4 | 2020-08-28T21:33:48.000Z | 2021-01-16T22:43:36.000Z | task3_doc2vec_svm.py | tomelf/cnit-623 | edf25f0b216b2480f7b651d3b94c1377dff721c0 | [
"MIT"
] | null | null | null | task3_doc2vec_svm.py | tomelf/cnit-623 | edf25f0b216b2480f7b651d3b94c1377dff721c0 | [
"MIT"
] | 4 | 2021-01-16T22:42:52.000Z | 2021-01-16T22:43:45.000Z | import data_loader
import numpy as np
import pandas as pd
import re
import os.path
from itertools import product
from string import ascii_lowercase
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.decomposition import PCA, TruncatedSVD
from sklearn.metrics import roc_auc_score, accuracy_score, classif... | 40.140351 | 106 | 0.741259 | import data_loader
import numpy as np
import pandas as pd
import re
import os.path
from itertools import product
from string import ascii_lowercase
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.decomposition import PCA, TruncatedSVD
from sklearn.metrics import roc_auc_score, accuracy_score, classif... | true | true |
f741bf7256c2d7d9c40f6a1a686af24b1cd1b716 | 2,918 | py | Python | openstack_dashboard/test/test_data/trove_data.py | spandanb/horizon | 4a96f2e2a2b087508c369e0bea891a29829a673d | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/test_data/trove_data.py | spandanb/horizon | 4a96f2e2a2b087508c369e0bea891a29829a673d | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/test_data/trove_data.py | spandanb/horizon | 4a96f2e2a2b087508c369e0bea891a29829a673d | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Rackspace Hosting.
#
# 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... | 29.474747 | 78 | 0.626799 |
from troveclient.v1 import backups
from troveclient.v1 import instances
from openstack_dashboard.test.test_data import utils
DATABASE_DATA_ONE = {
"status": "ACTIVE",
"updated": "2013-08-12T22:00:09",
"name": "Test Database",
"links": [],
"created": "2013-08-12T22:00:03",
"ip": ... | true | true |
f741c0813c7d76913a35d694a43a5d4e70a0526f | 2,009 | py | Python | keylime/cmd_exec.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/cmd_exec.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/cmd_exec.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import os
import subprocess
import time
EXIT_SUCESS = 0
def _execute(cmd, env=None, **kwargs):
proc = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, **kw... | 27.902778 | 84 | 0.642111 |
import os
import subprocess
import time
EXIT_SUCESS = 0
def _execute(cmd, env=None, **kwargs):
proc = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, **kwargs)
out, err = proc.communicate()
code = proc.returncode
return out, err, code
def... | true | true |
f741c0980a7cde085e267316044af0b54f0224f6 | 4,564 | py | Python | acapy_client/models/w3c_credentials_list_request.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | 4 | 2021-08-05T09:20:34.000Z | 2021-08-08T19:37:29.000Z | acapy_client/models/w3c_credentials_list_request.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | null | null | null | acapy_client/models/w3c_credentials_list_request.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | 2 | 2021-08-12T18:18:45.000Z | 2021-08-14T13:22:28.000Z | from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.w3c_credentials_list_request_tag_query import W3CCredentialsListRequestTagQuery
from ..types import UNSET, Unset
T = TypeVar("T", bound="W3CCredentialsListRequest")
@attr.s(auto_attribs=True)
class W3CCredentialsListRequest:
... | 34.059701 | 93 | 0.634531 | from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.w3c_credentials_list_request_tag_query import W3CCredentialsListRequestTagQuery
from ..types import UNSET, Unset
T = TypeVar("T", bound="W3CCredentialsListRequest")
@attr.s(auto_attribs=True)
class W3CCredentialsListRequest:
... | true | true |
f741c0db78edd42c5fe5293e199ee5df2b4f5ceb | 705 | py | Python | trails/feeds/socksproxy.py | vurtne/maltrail | 5ef8a3c6dba07d5d3b697c35412de95e164c3b9b | [
"MIT"
] | null | null | null | trails/feeds/socksproxy.py | vurtne/maltrail | 5ef8a3c6dba07d5d3b697c35412de95e164c3b9b | [
"MIT"
] | null | null | null | trails/feeds/socksproxy.py | vurtne/maltrail | 5ef8a3c6dba07d5d3b697c35412de95e164c3b9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
from core.common import retrieve_content
__url__ = "https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/socks_proxy_7d.ipset"
__check__ = "socks_proxy_7d"
__info__ = "proxy (... | 26.111111 | 98 | 0.665248 |
from core.common import retrieve_content
__url__ = "https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/socks_proxy_7d.ipset"
__check__ = "socks_proxy_7d"
__info__ = "proxy (suspicious)"
__reference__ = "socks-proxy.net"
def fetch():
retval = {}
content = retrieve_content(__url__)
if __c... | true | true |
f741c0f5ff9e40c057b436c9563746fc83e796f9 | 2,686 | py | Python | noxfile.py | amanchokshi/radio-dreams-v1 | 9371b9600a77f2d519f1815412f85201807703a3 | [
"MIT"
] | 1 | 2021-07-07T16:05:09.000Z | 2021-07-07T16:05:09.000Z | noxfile.py | amanchokshi/radio-dreams-v1 | 9371b9600a77f2d519f1815412f85201807703a3 | [
"MIT"
] | null | null | null | noxfile.py | amanchokshi/radio-dreams-v1 | 9371b9600a77f2d519f1815412f85201807703a3 | [
"MIT"
] | 1 | 2021-07-07T16:05:13.000Z | 2021-07-07T16:05:13.000Z | """Nox sessions."""
import tempfile
import nox
package = "radio_dreams"
nox.options.sessions = "lint", "tests"
locations = "src", "tests", "noxfile.py", "docs/conf.py"
def install_with_constraints(session, *args, **kwargs):
"""Install packages constrained by Poetry's lock file.
This function is a wrapper... | 29.195652 | 77 | 0.643336 |
import tempfile
import nox
package = "radio_dreams"
nox.options.sessions = "lint", "tests"
locations = "src", "tests", "noxfile.py", "docs/conf.py"
def install_with_constraints(session, *args, **kwargs):
with tempfile.NamedTemporaryFile() as requirements:
session.run(
"poetry",
... | true | true |
f741c1c95814209a6c7484dca1036f8f7429f208 | 5,378 | py | Python | gazoo_device/auxiliary_devices/efr32_pigweed_lighting.py | google/gazoo-device | f333b386f5993c8d4c9e12c89ebb620a0c4f5506 | [
"Apache-2.0"
] | 14 | 2020-11-05T23:23:32.000Z | 2022-03-01T18:59:29.000Z | gazoo_device/auxiliary_devices/efr32_pigweed_lighting.py | google/gazoo-device | f333b386f5993c8d4c9e12c89ebb620a0c4f5506 | [
"Apache-2.0"
] | null | null | null | gazoo_device/auxiliary_devices/efr32_pigweed_lighting.py | google/gazoo-device | f333b386f5993c8d4c9e12c89ebb620a0c4f5506 | [
"Apache-2.0"
] | 5 | 2021-05-20T22:52:51.000Z | 2022-02-21T08:46:21.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.837037 | 118 | 0.734288 |
from gazoo_device import decorators
from gazoo_device import detect_criteria
from gazoo_device import gdm_logger
from gazoo_device.base_classes import silabs_efr32_device
from gazoo_device.capabilities import pwrpc_button_default
from gazoo_device.capabilities import pwrpc_common_default
from gazoo_device... | true | true |
f741c1f30a6166e56d63d1ac3997ffaf6925be2f | 8,702 | py | Python | L04_Task_1.py | Alibek80/Algorithms-Python-Base | 3821e63f29a6c49c122a5fd1d168f8e77107ba0a | [
"Apache-2.0"
] | null | null | null | L04_Task_1.py | Alibek80/Algorithms-Python-Base | 3821e63f29a6c49c122a5fd1d168f8e77107ba0a | [
"Apache-2.0"
] | null | null | null | L04_Task_1.py | Alibek80/Algorithms-Python-Base | 3821e63f29a6c49c122a5fd1d168f8e77107ba0a | [
"Apache-2.0"
] | null | null | null | # Проанализировать скорость и сложность одного любого алгоритма,
# разработанных в рамках домашнего задания первых трех уроков.
# В массиве случайных целых чисел поменять местами минимальный и максимальный элементы.
import random
import cProfile
def generate_array(size, min_item, max_item):
return [random.randi... | 53.716049 | 98 | 0.574581 |
import random
import cProfile
def generate_array(size, min_item, max_item):
return [random.randint(min_item, max_item) for _ in range(size)]
def swap_min_max_1(size):
array = generate_array(size, 0, 100)
min_val = array[0]
min_idx = 0
max_val = array[0]
max_idx = 0
for i in range(... | true | true |
f741c30ef8b3474e2b74fb44fc7af3dd7eea3dc8 | 115,202 | py | Python | sympy/core/function.py | MiguelAMLucero/sympy | f7b590d22262b4f9728b60e51c31df237df22e35 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/function.py | MiguelAMLucero/sympy | f7b590d22262b4f9728b60e51c31df237df22e35 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/function.py | MiguelAMLucero/sympy | f7b590d22262b4f9728b60e51c31df237df22e35 | [
"BSD-3-Clause"
] | null | null | null | """
There are three types of functions implemented in SymPy:
1) defined functions (in the sense that they can be evaluated) like
exp or sin; they have a name and a body:
f = exp
2) undefined function which have a name but no body. Undefined
functions can be defined using a Function cla... | 34.144043 | 165 | 0.559843 |
from typing import Any, Dict as tDict, Optional, Set as tSet, Tuple as tTuple, Union as tUnion
from collections.abc import Iterable
from .add import Add
from .assumptions import ManagedProperties
from .basic import Basic, _atomic
from .cache import cacheit
from .containers import Tuple, Dict
from .decorators import _... | true | true |
f741c3830af3558d7a329cb0a5ab777dc46ceb79 | 627 | py | Python | Temperature Scale Converter/temperature_scale_converter.py | lachenlama/ScriptAllTheThings | a738eb069802a596c5212d81c5f401965fc92851 | [
"MIT"
] | null | null | null | Temperature Scale Converter/temperature_scale_converter.py | lachenlama/ScriptAllTheThings | a738eb069802a596c5212d81c5f401965fc92851 | [
"MIT"
] | null | null | null | Temperature Scale Converter/temperature_scale_converter.py | lachenlama/ScriptAllTheThings | a738eb069802a596c5212d81c5f401965fc92851 | [
"MIT"
] | null | null | null | """
Temperature Scale Converter
- Converts celsius sclae to fahrenheit and vice-versa
Author : (Niyoj Oli)[https://github.com/niyoj]
Date : 24/09/21
"""
temp = input("Input the temperature you would like to convert? (e.g., 45F, 102C etc.) : ")
degree = int(temp[:-1])
i_convention = temp[-1]
if i_convention.upper() =... | 28.5 | 91 | 0.665072 |
temp = input("Input the temperature you would like to convert? (e.g., 45F, 102C etc.) : ")
degree = int(temp[:-1])
i_convention = temp[-1]
if i_convention.upper() == "C":
result = int(round((9 * degree) / 5 + 32))
o_convention = "Fahrenheit"
elif i_convention.upper() == "F":
result = int(round((degree - 32) * ... | true | true |
f741c3e194397df6f8160a66f4dd58e435ff01b7 | 2,158 | py | Python | mergify_engine/tests/functional/actions/test_rebase.py | oharboe/mergify-engine | 70785b1b1d9b2360f7a41c6d7f560e39d9ec4905 | [
"Apache-2.0"
] | null | null | null | mergify_engine/tests/functional/actions/test_rebase.py | oharboe/mergify-engine | 70785b1b1d9b2360f7a41c6d7f560e39d9ec4905 | [
"Apache-2.0"
] | 24 | 2022-02-14T08:36:56.000Z | 2022-03-31T07:35:47.000Z | mergify_engine/tests/functional/actions/test_rebase.py | oharboe/mergify-engine | 70785b1b1d9b2360f7a41c6d7f560e39d9ec4905 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2021 Mergify SAS
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.253968 | 85 | 0.644115 |
from unittest import mock
import yaml
from mergify_engine.tests.functional import base
class TestRebaseAction(base.FunctionalTestBase):
async def _do_test_rebase(self):
rules = {
"pull_request_rules": [
{
"name": "rebase",
... | true | true |
f741c6261b18f3fff261e4f49dcef637ddba1774 | 119 | py | Python | cobyqa/linalg/__init__.py | ragonneau/cobyqa | 06c598ed0e3a9ccd030568a677175fdfddbf3821 | [
"BSD-3-Clause"
] | 4 | 2021-11-11T08:38:56.000Z | 2022-03-09T05:44:08.000Z | cobyqa/linalg/__init__.py | ragonneau/cobyqa | 06c598ed0e3a9ccd030568a677175fdfddbf3821 | [
"BSD-3-Clause"
] | 1 | 2021-11-11T00:27:37.000Z | 2021-11-11T00:27:37.000Z | cobyqa/linalg/__init__.py | ragonneau/cobyqa | 06c598ed0e3a9ccd030568a677175fdfddbf3821 | [
"BSD-3-Clause"
] | null | null | null | from .main import bvcs, bvlag, bvtcg, cpqp, lctcg, nnls
__all__ = ['bvcs', 'bvlag', 'bvtcg', 'cpqp', 'lctcg', 'nnls']
| 29.75 | 61 | 0.630252 | from .main import bvcs, bvlag, bvtcg, cpqp, lctcg, nnls
__all__ = ['bvcs', 'bvlag', 'bvtcg', 'cpqp', 'lctcg', 'nnls']
| true | true |
f741ca3c5acb4ed8b79563eab78eb6a7230ea498 | 13,684 | py | Python | vendor/github.com/youtube/vitess/test/vtgate_buffer.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | 1 | 2017-06-29T04:57:43.000Z | 2017-06-29T04:57:43.000Z | vendor/github.com/youtube/vitess/test/vtgate_buffer.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | null | null | null | vendor/github.com/youtube/vitess/test/vtgate_buffer.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | 3 | 2017-04-03T21:07:17.000Z | 2020-03-04T04:59:05.000Z | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""Test the vtgate master buffer.
During a master failover, vtgate should automatically buffer (stall) requests
for a configured time and retr... | 34.643038 | 80 | 0.665303 |
import logging
import Queue
import random
import threading
import time
import unittest
import environment
import tablet
import utils
from mysql_flavor import mysql_flavor
KEYSPACE = 'ks1'
SHARD = '0'
SCHEMA = '''CREATE TABLE buffer(
id BIGINT NOT NULL,
msg VARCHAR(64) NOT NULL,
PRIMARY KEY (id)
) ENGINE... | true | true |
f741cb9f2f7b4b19311a89635be888eae55ba82a | 4,279 | py | Python | python/rover_publisher.py | srmainwaring/python-ignition | 720f2e6d8e675ed7e10488caf11ef7e93e519d58 | [
"Apache-2.0"
] | 3 | 2022-01-05T19:25:42.000Z | 2022-02-28T02:51:28.000Z | python/rover_publisher.py | srmainwaring/python-ignition | 720f2e6d8e675ed7e10488caf11ef7e93e519d58 | [
"Apache-2.0"
] | 4 | 2022-01-10T16:54:30.000Z | 2022-01-11T15:38:41.000Z | python/rover_publisher.py | srmainwaring/python-ignition | 720f2e6d8e675ed7e10488caf11ef7e93e519d58 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2022 Rhys Mainwaring
#
# 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 applicabl... | 29.510345 | 78 | 0.597102 |
import Rotation as Rotation
import math
import time
from ignition.msgs.header_pb2 import Header
from ignition.msgs.pose_pb2 import Pose
from ignition.msgs.quaternion_pb2 import Quaternion
from ignition.msgs.time_pb2 import Time
from ignition.msgs.twist_pb2 import Twist
from ignition.msgs.vector3d_pb2 import V... | true | true |
f741cc518c05a8b391a1bc8b2ebc2d8a787955a9 | 9,594 | py | Python | doc/conf.py | sdss/lvmutil | 1938f6e1d7f4074a90a55570a316886850c5c6af | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | sdss/lvmutil | 1938f6e1d7f4074a90a55570a316886850c5c6af | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | sdss/lvmutil | 1938f6e1d7f4074a90a55570a316886850c5c6af | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# desiutil documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 9 10:43:33 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | 32.086957 | 122 | 0.714822 |
import sys
import os
from importlib import import_module
sys.path.insert(0, os.path.abspath('../py'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon'
]
intersphinx_map... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.