hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c26c3638b1316c8ecd0a547588012f1f89b3e0d | 11,907 | py | Python | cimcb/plot/permutation_test.py | CIMCB/cimcb | 5d30f80423ed94e1068871b30e465b38d451581a | [
"MIT"
] | 5 | 2020-05-26T23:45:40.000Z | 2022-01-13T00:40:14.000Z | cimcb/plot/permutation_test.py | CIMCB/cimcb | 5d30f80423ed94e1068871b30e465b38d451581a | [
"MIT"
] | 3 | 2020-10-20T09:03:18.000Z | 2021-11-01T14:22:05.000Z | cimcb/plot/permutation_test.py | KevinMMendez/cimcb | fe831253b122ed0ff9e33cbd160ef721abee1e38 | [
"MIT"
] | 4 | 2020-10-12T07:17:43.000Z | 2022-03-28T06:28:44.000Z | import numpy as np
import scipy
import multiprocessing
from pydoc import locate
from copy import deepcopy, copy
from joblib import Parallel, delayed
from bokeh.layouts import gridplot
from statsmodels.stats.weightstats import ttest_ind
from bokeh.models import HoverTool, Slope, Span
from bokeh.plotting import ColumnDat... | 40.5 | 175 | 0.586882 | import numpy as np
import scipy
import multiprocessing
from pydoc import locate
from copy import deepcopy, copy
from joblib import Parallel, delayed
from bokeh.layouts import gridplot
from statsmodels.stats.weightstats import ttest_ind
from bokeh.models import HoverTool, Slope, Span
from bokeh.plotting import ColumnDat... | true | true |
1c26c473965d086ca26698f57ba94665eaebdc7a | 847 | py | Python | dashboard/kpi.py | ljakab/spectrometer | 92bfcb4987cb362e6686d3694b9cdd2d624368f3 | [
"Apache-2.0"
] | null | null | null | dashboard/kpi.py | ljakab/spectrometer | 92bfcb4987cb362e6686d3694b9cdd2d624368f3 | [
"Apache-2.0"
] | null | null | null | dashboard/kpi.py | ljakab/spectrometer | 92bfcb4987cb362e6686d3694b9cdd2d624368f3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 30.25 | 69 | 0.748524 |
import flask
from dashboard import decorators
blueprint = flask.Blueprint('kpi', __name__, url_prefix='/kpi')
@blueprint.route('/<path:path>')
@decorators.exception_handler()
def kpi_report(path):
return flask.render_template('kpi/' + path + '.html'), 200
| true | true |
1c26c4ede6a3127d9a847222c99cceecb9bd2e8e | 61,720 | py | Python | modules/s3db/vulnerability.py | e2000y/eden | d2751e0a2f8f859275212e55c2b101646cb2d8c2 | [
"MIT"
] | null | null | null | modules/s3db/vulnerability.py | e2000y/eden | d2751e0a2f8f859275212e55c2b101646cb2d8c2 | [
"MIT"
] | null | null | null | modules/s3db/vulnerability.py | e2000y/eden | d2751e0a2f8f859275212e55c2b101646cb2d8c2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Sahana Eden Vulnerability Model
@copyright: 2012-2021 (c) Sahana Software Foundation
@license: MIT
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... | 43.618375 | 106 | 0.459089 |
__all__ = ("VulnerabilityModel",
"HazardModel",
"RiskModel",
"vulnerability_aggregated_period",
"vulnerability_pids",
"vulnerability_resilience_id",
"vulnerability_rheader",
"vulnerability_rebuild_all_aggregates",
... | true | true |
1c26c517c5b5b7fd035f030ab601be69f679464b | 4,250 | py | Python | qa/rpc-tests/smartfees.py | HaloExchange/HaloBitcoin | 157643cb330d6600da53866097a8ead609600a94 | [
"MIT"
] | null | null | null | qa/rpc-tests/smartfees.py | HaloExchange/HaloBitcoin | 157643cb330d6600da53866097a8ead609600a94 | [
"MIT"
] | null | null | null | qa/rpc-tests/smartfees.py | HaloExchange/HaloBitcoin | 157643cb330d6600da53866097a8ead609600a94 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014 The Halo Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test fee estimation code
#
from test_framework import BitcoinTestFramework
from halobitcoinrpc.authp... | 45.698925 | 114 | 0.606824 |
from test_framework import BitcoinTestFramework
from halobitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
class EstimateFeeTest(BitcoinTestFramework):
def setup_network(self):
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir,
... | true | true |
1c26c5d6e25c1a37b16105c9a996e7b117aa6ed0 | 680 | py | Python | tests/cli/workflows/test_q2r.py | rikigigi/aiida-quantumespresso | 2ca8be36d5692d1000ca92f0419bdb044bebcb35 | [
"MIT"
] | null | null | null | tests/cli/workflows/test_q2r.py | rikigigi/aiida-quantumespresso | 2ca8be36d5692d1000ca92f0419bdb044bebcb35 | [
"MIT"
] | null | null | null | tests/cli/workflows/test_q2r.py | rikigigi/aiida-quantumespresso | 2ca8be36d5692d1000ca92f0419bdb044bebcb35 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for the ``calculation launch q2r`` command."""
import pytest
from aiida_quantumespresso.cli.calculations.q2r import launch_calculation
@pytest.mark.usefixtures('clear_database_before_test')
def test_command_base(run_cli_process_launch_command, fixture_code, generate_calc_job_node):
... | 45.333333 | 92 | 0.775 |
import pytest
from aiida_quantumespresso.cli.calculations.q2r import launch_calculation
@pytest.mark.usefixtures('clear_database_before_test')
def test_command_base(run_cli_process_launch_command, fixture_code, generate_calc_job_node):
code = fixture_code('quantumespresso.q2r').store()
calculation = generat... | true | true |
1c26c6183c9247f73cf053294036a06beb9373c8 | 2,313 | py | Python | setup.py | daxee/foostache-python | 9d382ed2145c1021265efe94f3a303671a347c87 | [
"MIT"
] | 1 | 2020-10-07T18:02:41.000Z | 2020-10-07T18:02:41.000Z | setup.py | daxee/foostache-python | 9d382ed2145c1021265efe94f3a303671a347c87 | [
"MIT"
] | 5 | 2019-01-12T20:17:19.000Z | 2019-01-12T23:02:08.000Z | setup.py | daxee/foostache-python | 9d382ed2145c1021265efe94f3a303671a347c87 | [
"MIT"
] | null | null | null | import io
import os
import re
from setuptools import setup
import sys
PACKAGES = [
"foostache",
]
INSTALL_REQUIRES = [
"future~=0.17.1",
"ujson~=1.35",
]
if sys.version_info[0] == 2:
PACKAGES.append("foostache.py2parser")
INSTALL_REQUIRES.append("antlr4-python2-runtime~=4.7.2")
elif sys.version_... | 29.278481 | 88 | 0.625594 | import io
import os
import re
from setuptools import setup
import sys
PACKAGES = [
"foostache",
]
INSTALL_REQUIRES = [
"future~=0.17.1",
"ujson~=1.35",
]
if sys.version_info[0] == 2:
PACKAGES.append("foostache.py2parser")
INSTALL_REQUIRES.append("antlr4-python2-runtime~=4.7.2")
elif sys.version_... | true | true |
1c26c67209841c52dc453f2b8e946d16c021f566 | 7,870 | py | Python | scripts/trajectories.py | nahanoo/black_queen_hypothesis | 3b358457a0ea068b0f75c1bfb91b29be7aa59758 | [
"MIT"
] | null | null | null | scripts/trajectories.py | nahanoo/black_queen_hypothesis | 3b358457a0ea068b0f75c1bfb91b29be7aa59758 | [
"MIT"
] | null | null | null | scripts/trajectories.py | nahanoo/black_queen_hypothesis | 3b358457a0ea068b0f75c1bfb91b29be7aa59758 | [
"MIT"
] | null | null | null | import vcfpy
from samples import Samples
from os.path import join, exists
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from Bio import SeqIO
from colour import Color
s = Samples()
class SNPs:
def __init__(self, filter=20, parse=False):
if parse:
self.snps ... | 43.241758 | 105 | 0.494917 | import vcfpy
from samples import Samples
from os.path import join, exists
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from Bio import SeqIO
from colour import Color
s = Samples()
class SNPs:
def __init__(self, filter=20, parse=False):
if parse:
self.snps ... | true | true |
1c26c6cf7b3494913f618a69654e6b56034da51c | 856 | py | Python | project/urls.py | Belie06Loryn/Project_Post | 68997d6608c7c3f24b3985497da5b53c8c58785c | [
"Unlicense"
] | null | null | null | project/urls.py | Belie06Loryn/Project_Post | 68997d6608c7c3f24b3985497da5b53c8c58785c | [
"Unlicense"
] | 2 | 2021-06-08T20:31:59.000Z | 2021-09-08T01:22:46.000Z | project/urls.py | Belie06Loryn/Project_Post | 68997d6608c7c3f24b3985497da5b53c8c58785c | [
"Unlicense"
] | null | null | null | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$',views.page,name = 'page'),
url(r'^submit/$',views.submit,name = 'submit'),
url(r'^profile/$',views.profile,name = 'profile'),
url(r'^profile_display/$... | 42.8 | 81 | 0.676402 | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$',views.page,name = 'page'),
url(r'^submit/$',views.submit,name = 'submit'),
url(r'^profile/$',views.profile,name = 'profile'),
url(r'^profile_display/$... | true | true |
1c26c709941b89bac8bb584fa473b251f67f7e4a | 87 | py | Python | src/fhir_types/FHIR_canonical.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | 2 | 2022-02-03T00:51:30.000Z | 2022-02-03T18:42:43.000Z | src/fhir_types/FHIR_canonical.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | null | null | null | src/fhir_types/FHIR_canonical.py | anthem-ai/fhir-types | 42348655fb3a9b3f131b911d6bc0782da8c14ce4 | [
"Apache-2.0"
] | null | null | null | # A URI that is a reference to a canonical URL on a FHIR resource
FHIR_canonical = str
| 29 | 65 | 0.770115 |
FHIR_canonical = str
| true | true |
1c26c72348e717706ed32d4459b3a31a95c7bae2 | 1,436 | py | Python | tests/runtime/test_model_interface.py | koskotG/ebonite | 9f9ae016b70fb24865d5edc99142afb8ab4ddc59 | [
"Apache-2.0"
] | null | null | null | tests/runtime/test_model_interface.py | koskotG/ebonite | 9f9ae016b70fb24865d5edc99142afb8ab4ddc59 | [
"Apache-2.0"
] | null | null | null | tests/runtime/test_model_interface.py | koskotG/ebonite | 9f9ae016b70fb24865d5edc99142afb8ab4ddc59 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import pytest
from pyjackson import deserialize
from ebonite.core.objects.core import Model
from ebonite.core.objects.requirements import Requirements
from ebonite.ext.sklearn import SklearnModelWrapper
from ebonite.runtime.interface.ml_model import model_interface
class Pandas... | 25.192982 | 84 | 0.720752 | import numpy as np
import pandas as pd
import pytest
from pyjackson import deserialize
from ebonite.core.objects.core import Model
from ebonite.core.objects.requirements import Requirements
from ebonite.ext.sklearn import SklearnModelWrapper
from ebonite.runtime.interface.ml_model import model_interface
class Pandas... | true | true |
1c26c72b08d536889d0066b29992f1c0a4a9621b | 2,049 | py | Python | src/xncview/interpret_cf.py | ScottWales/xncview | 06ed9fb5036c0078a3f96b8eac42622e317304bd | [
"Apache-2.0"
] | null | null | null | src/xncview/interpret_cf.py | ScottWales/xncview | 06ed9fb5036c0078a3f96b8eac42622e317304bd | [
"Apache-2.0"
] | null | null | null | src/xncview/interpret_cf.py | ScottWales/xncview | 06ed9fb5036c0078a3f96b8eac42622e317304bd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2019 Scott Wales
#
# Author: Scott Wales <scott.wales@unimelb.edu.au>
#
# 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/license... | 25.6125 | 74 | 0.606149 |
lat_units = set((
'degrees_north',
'degrees_N',
'degreesN',
'degree_north',
'degree_N',
'degreeN',
))
lon_units = set((
'degrees_east',
'degrees_E',
'degreesE',
'degree_east',
'degree_E',
'degreeE'... | true | true |
1c26c764be9c466c672f3a1b3b8671cdbe8bd09f | 2,270 | py | Python | nsd1805/python/day14/ad_hoc.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1805/python/day14/ad_hoc.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1805/python/day14/ad_hoc.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | import shutil
from collections import namedtuple
# ansible.constants是ansible的常量
import ansible.constants as C
# TaskQueueManager用于管理、协调任务的调用、执行
from ansible.executor.task_queue_manager import TaskQueueManager
# InventoryManager用于管理ansible的主机清单
from ansible.inventory.manager import InventoryManager
# DataLoader识别并处理配置文件... | 32.898551 | 154 | 0.720705 | import shutil
from collections import namedtuple
import ansible.constants as C
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.inventory.manager import InventoryManager
from ansible.parsing.dataloader import DataLoader
from ansible.playbook.play import Play
from ansible.vars.manager ... | true | true |
1c26c84702a8fe213019f7514282aeb289b55eda | 1,533 | py | Python | ml/morvan/sklearn/sk8_cross_validation.py | danyfang/SourceCode | 8168f6058648f2a330a7354daf3a73a4d8a4e730 | [
"MIT"
] | null | null | null | ml/morvan/sklearn/sk8_cross_validation.py | danyfang/SourceCode | 8168f6058648f2a330a7354daf3a73a4d8a4e730 | [
"MIT"
] | null | null | null | ml/morvan/sklearn/sk8_cross_validation.py | danyfang/SourceCode | 8168f6058648f2a330a7354daf3a73a4d8a4e730 | [
"MIT"
] | null | null | null | # View more python learning tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code acco... | 26.431034 | 109 | 0.759948 |
from __future__ import print_function
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
iris = load_iris()
X = iris.data
y = iris.target
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=4)
knn = KNe... | true | true |
1c26c9092ad884f9f0ee672a7865f393bd11be85 | 958 | py | Python | knodle_experiments/config/snorkel.py | knodle/knodle-experiments | 0a635f3a181432901509b59511ef9d8f8ffb3187 | [
"Apache-2.0"
] | null | null | null | knodle_experiments/config/snorkel.py | knodle/knodle-experiments | 0a635f3a181432901509b59511ef9d8f8ffb3187 | [
"Apache-2.0"
] | 1 | 2021-05-18T08:56:39.000Z | 2021-05-18T08:56:39.000Z | knodle_experiments/config/snorkel.py | knodle/knodle-experiments | 0a635f3a181432901509b59511ef9d8f8ffb3187 | [
"Apache-2.0"
] | null | null | null | from typing import Dict
from knodle_experiments.config.model_configs import (
get_standard_bert_config, get_standard_logistic_regression_config
)
def get_logistic_regression_config(dataset: str) -> Dict:
config = get_standard_logistic_regression_config(dataset)
config["method"] = "snorkel"
return con... | 28.176471 | 69 | 0.729645 | from typing import Dict
from knodle_experiments.config.model_configs import (
get_standard_bert_config, get_standard_logistic_regression_config
)
def get_logistic_regression_config(dataset: str) -> Dict:
config = get_standard_logistic_regression_config(dataset)
config["method"] = "snorkel"
return con... | true | true |
1c26c9156ae069de16cb850d3e8eeb984c1f8ca8 | 978 | py | Python | bluebottle/follow/tests/factories.py | jayvdb/bluebottle | 305fea238e6aa831598a8b227223a1a2f34c4fcc | [
"BSD-3-Clause"
] | null | null | null | bluebottle/follow/tests/factories.py | jayvdb/bluebottle | 305fea238e6aa831598a8b227223a1a2f34c4fcc | [
"BSD-3-Clause"
] | null | null | null | bluebottle/follow/tests/factories.py | jayvdb/bluebottle | 305fea238e6aa831598a8b227223a1a2f34c4fcc | [
"BSD-3-Clause"
] | null | null | null | from builtins import object
import factory
from bluebottle.follow.models import Follow
from bluebottle.initiatives.tests.factories import InitiativeFactory
from bluebottle.events.tests.factories import EventFactory
from bluebottle.funding.tests.factories import FundingFactory
from bluebottle.test.factory_models.accoun... | 32.6 | 73 | 0.801636 | from builtins import object
import factory
from bluebottle.follow.models import Follow
from bluebottle.initiatives.tests.factories import InitiativeFactory
from bluebottle.events.tests.factories import EventFactory
from bluebottle.funding.tests.factories import FundingFactory
from bluebottle.test.factory_models.accoun... | true | true |
1c26ca1992b5dde2992b03948c2a11989d96907d | 3,214 | py | Python | pcdsdevices/sim.py | vespos/pcdsdevices | 7c4728df62ea58b6491d1cb36bb39d27d6dd9fca | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/sim.py | vespos/pcdsdevices | 7c4728df62ea58b6491d1cb36bb39d27d6dd9fca | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/sim.py | vespos/pcdsdevices | 7c4728df62ea58b6491d1cb36bb39d27d6dd9fca | [
"BSD-3-Clause-LBNL"
] | null | null | null | import threading
import time
from ophyd.device import Component as Cpt
from ophyd.device import Device
from ophyd.ophydobj import Kind
from ophyd.positioner import SoftPositioner
from ophyd.signal import AttributeSignal
from ophyd.sim import SynAxis
from .interface import FltMvInterface, tweak_base
class SynMotor(F... | 31.509804 | 77 | 0.637834 | import threading
import time
from ophyd.device import Component as Cpt
from ophyd.device import Device
from ophyd.ophydobj import Kind
from ophyd.positioner import SoftPositioner
from ophyd.signal import AttributeSignal
from ophyd.sim import SynAxis
from .interface import FltMvInterface, tweak_base
class SynMotor(F... | true | true |
1c26ca1abcbdc515399292d9cb2da13c2168fba2 | 1,929 | py | Python | Postcodes_grid.py | ganetin/UK_postcodes | c4e303203c8e156f6e03f09e01bb6fb0111dae7b | [
"MIT"
] | null | null | null | Postcodes_grid.py | ganetin/UK_postcodes | c4e303203c8e156f6e03f09e01bb6fb0111dae7b | [
"MIT"
] | null | null | null | Postcodes_grid.py | ganetin/UK_postcodes | c4e303203c8e156f6e03f09e01bb6fb0111dae7b | [
"MIT"
] | null | null | null | #------------------------------------#
# import libraries
#------------------------------------#
import postcodes_io_api
import geopandas as gpd
import csv
#------------------------------------#
#------------------------------------#
# Reads the GEOSTAT grid, filters to the UK only, projects the data and obtains the ... | 40.1875 | 121 | 0.543287 |
import postcodes_io_api
import geopandas as gpd
import csv
grid=gpd.read_file("grid_5km_point.gpkg")
grid_UK=grid[grid["CNTR_ID"]=="UK"]
grid_projected=grid_UK.to_crs(epsg=4326)
grid_projected['lon'] = grid_projected['geometry'].x
grid_projected['lat'] = grid_projected['geometry'].y
pst_obtained=0
api = po... | true | true |
1c26ca36531d467d25e7e1a40ac38104d5c2e341 | 1,658 | py | Python | page_objects/PageFactory.py | monoranjanqxf2/evaluation1 | 28d8542e8add41318cc0f57d0203f2e4e2c87a4c | [
"MIT"
] | null | null | null | page_objects/PageFactory.py | monoranjanqxf2/evaluation1 | 28d8542e8add41318cc0f57d0203f2e4e2c87a4c | [
"MIT"
] | null | null | null | page_objects/PageFactory.py | monoranjanqxf2/evaluation1 | 28d8542e8add41318cc0f57d0203f2e4e2c87a4c | [
"MIT"
] | 1 | 2020-01-06T13:09:26.000Z | 2020-01-06T13:09:26.000Z | """
PageFactory uses the factory design pattern.
get_page_object() returns the appropriate page object.
Add elif clauses as and when you implement new pages.
Pages implemented so far:
1. Weather shopper main page
2. Moisturizers page
3. Sunscreens page
4. Checkout and payment page
"""
from page_objects.moisturizer_pa... | 43.631579 | 107 | 0.767189 |
from page_objects.moisturizer_page import Moisturizer_Page
from page_objects.sunscreen_page import Sunscreen_Page
from page_objects.cart_page import Cart_Page
from page_objects.payment_page import Payment_Page
from page_objects.weather_shopper_main_page import Weather_Shopper_Main_Page
from conf import base_url_conf a... | true | true |
1c26ca3d90c84070ad973976d1e4f4657e3b4b8f | 6,614 | py | Python | src/streamlink/plugins/rtve.py | RomanKornev/streamlink | acdefee0822b9c10628b91a166f9abe084e44800 | [
"BSD-2-Clause"
] | 2 | 2019-09-17T15:01:47.000Z | 2019-09-21T16:26:50.000Z | src/streamlink/plugins/rtve.py | RomanKornev/streamlink | acdefee0822b9c10628b91a166f9abe084e44800 | [
"BSD-2-Clause"
] | 1 | 2020-06-02T02:36:30.000Z | 2020-06-02T02:36:30.000Z | src/streamlink/plugins/rtve.py | bumplzz69/streamlink | 34abc43875d7663ebafa241573dece272e93d88b | [
"BSD-2-Clause"
] | 1 | 2020-03-08T15:53:50.000Z | 2020-03-08T15:53:50.000Z | import base64
import logging
import re
from functools import partial
from Crypto.Cipher import Blowfish
from streamlink.compat import bytes, is_py3
from streamlink.plugin import Plugin, PluginArguments, PluginArgument
from streamlink.plugin.api import useragents
from streamlink.plugin.api import validate
from streaml... | 36.340659 | 116 | 0.574539 | import base64
import logging
import re
from functools import partial
from Crypto.Cipher import Blowfish
from streamlink.compat import bytes, is_py3
from streamlink.plugin import Plugin, PluginArguments, PluginArgument
from streamlink.plugin.api import useragents
from streamlink.plugin.api import validate
from streaml... | true | true |
1c26caf43e97e81e8ae7b3412a9ef65e970af9c9 | 196 | py | Python | app/parameter.py | mfurquim/finance-backend | 2ef172217a4cb5602d5b8c1ec5605994662e5155 | [
"MIT"
] | 1 | 2022-02-18T11:19:22.000Z | 2022-02-18T11:19:22.000Z | app/parameter.py | mfurquim/finance-backend | 2ef172217a4cb5602d5b8c1ec5605994662e5155 | [
"MIT"
] | null | null | null | app/parameter.py | mfurquim/finance-backend | 2ef172217a4cb5602d5b8c1ec5605994662e5155 | [
"MIT"
] | null | null | null | import os
def get_env(option):
def log_level():
return (os.getenv('LOG_LEVEL', 'INFO')).upper()
options = {
'LOG_LEVEL': log_level,
}
return options[option]()
| 14 | 55 | 0.571429 | import os
def get_env(option):
def log_level():
return (os.getenv('LOG_LEVEL', 'INFO')).upper()
options = {
'LOG_LEVEL': log_level,
}
return options[option]()
| true | true |
1c26cc5a90c8c3722e5873756cee428bd0bb7351 | 1,653 | py | Python | examples/adspygoogle/dfp/v201206/get_all_creatives.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201206/get_all_creatives.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201206/get_all_creatives.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 33.734694 | 80 | 0.731397 |
"""This code example gets all creatives. To create creatives, run
create_creatives.py."""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..', '..'))
from adspygoogle import DfpClient
from adspygoogle.dfp import DfpUtils
client... | false | true |
1c26cd31132494b9bf49040a5e7c9134f9d054f7 | 6,495 | py | Python | coc/war_clans.py | wpmjones/coc.py | 72105881d62a9a43f9f4b3535eba72c67feb1447 | [
"MIT"
] | null | null | null | coc/war_clans.py | wpmjones/coc.py | 72105881d62a9a43f9f4b3535eba72c67feb1447 | [
"MIT"
] | null | null | null | coc/war_clans.py | wpmjones/coc.py | 72105881d62a9a43f9f4b3535eba72c67feb1447 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2019-2020 mathsman5133
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publ... | 34.73262 | 117 | 0.647113 | import typing
from .abc import BaseClan
from .war_members import ClanWarMember, ClanWarLeagueClanMember
from .utils import correct_tag
if typing.TYPE_CHECKING:
from .war_attack import WarAttack
class WarClan(BaseClan):
__slots__ = (
"destruction",
"level",
"attacks_used",
... | true | true |
1c26ce0f9e4e7e513d0318aa9562d7639412b569 | 416 | py | Python | 2021/Day 07/day07.py | nicoloverardo/aoc | 3645c6826880fa3c86686a84cf715796a785cc5b | [
"BSD-3-Clause"
] | null | null | null | 2021/Day 07/day07.py | nicoloverardo/aoc | 3645c6826880fa3c86686a84cf715796a785cc5b | [
"BSD-3-Clause"
] | null | null | null | 2021/Day 07/day07.py | nicoloverardo/aoc | 3645c6826880fa3c86686a84cf715796a785cc5b | [
"BSD-3-Clause"
] | null | null | null | from statistics import median
with open("2021/Day 07/input.txt", "r") as f:
vals = list(map(int, f.read().strip().split(",")))
# Part one
mdn = median(vals)
dists = [abs(mdn - x) for x in vals]
print(str(int(sum(dists))))
# Part 2
fuel = lambda d: d*(d+1) // 2
outcomes = []
for y in range(min(vals), max(vals) + 1)... | 21.894737 | 66 | 0.622596 | from statistics import median
with open("2021/Day 07/input.txt", "r") as f:
vals = list(map(int, f.read().strip().split(",")))
mdn = median(vals)
dists = [abs(mdn - x) for x in vals]
print(str(int(sum(dists))))
fuel = lambda d: d*(d+1) // 2
outcomes = []
for y in range(min(vals), max(vals) + 1):
outcomes.append... | true | true |
1c26ce70f2e5b911e38c3ddea5d52edc19e5b269 | 1,077 | py | Python | h5sh/commands/open_file.py | jl-wynen/h5shell | 9461c08b4eefe0d28f59fdc6dbf7c0a73305553e | [
"MIT"
] | 1 | 2021-07-21T11:00:51.000Z | 2021-07-21T11:00:51.000Z | h5sh/commands/open_file.py | jl-wynen/h5shell | 9461c08b4eefe0d28f59fdc6dbf7c0a73305553e | [
"MIT"
] | null | null | null | h5sh/commands/open_file.py | jl-wynen/h5shell | 9461c08b4eefe0d28f59fdc6dbf7c0a73305553e | [
"MIT"
] | 1 | 2017-10-13T08:50:19.000Z | 2017-10-13T08:50:19.000Z | """
Module for open_file command.
"""
import re
from . import command
class open_file(command.Command):
"""Command to open a new HDF5 file."""
def __init__(self):
super(open_file, self).__init__()
self._parser = command.Command.Parser(prog="open",
... | 30.771429 | 119 | 0.514392 |
import re
from . import command
class open_file(command.Command):
def __init__(self):
super(open_file, self).__init__()
self._parser = command.Command.Parser(prog="open",
description="Switch to another HDF5 file.")
self._parser.add_argument(... | true | true |
1c26ceafbf1d697dc5a0021b4e85c207a9eb3b9e | 9,558 | py | Python | albow/file_dialogs.py | TrazLander/Traz-Fork-MCEdit-Unified | 829a6807ec3f64a6e936c5b5b9a0ec8e03c75954 | [
"0BSD"
] | null | null | null | albow/file_dialogs.py | TrazLander/Traz-Fork-MCEdit-Unified | 829a6807ec3f64a6e936c5b5b9a0ec8e03c75954 | [
"0BSD"
] | 1 | 2015-03-09T22:50:53.000Z | 2015-03-11T21:59:49.000Z | albow/file_dialogs.py | TrazLander/Traz-Fork-MCEdit-Unified | 829a6807ec3f64a6e936c5b5b9a0ec8e03c75954 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Albow - File Dialogs
#
#-# Modified by D.C.-G. for translation purpose
import os
from pygame import draw, Rect
from pygame.locals import *
from albow.widget import Widget
from albow.dialogs import Dialog, ask, alert
from albow.controls import Label, Button
from albow.fields import TextField
... | 28.963636 | 81 | 0.601276 |
pygame.locals import *
from albow.widget import Widget
from albow.dialogs import Dialog, ask, alert
from albow.controls import Label, Button
from albow.fields import TextField
from albow.layout import Row, Column
from albow.palette_view import PaletteView
from albow.theme import ThemeProperty
from translate import... | false | true |
1c26cee481b4688328293b85dc73528ea1523495 | 493 | py | Python | tests/conftest.py | bpicolo/adjure | 974b4465ea9a827074472410d3013c3b5306b5d2 | [
"MIT"
] | 5 | 2016-06-02T03:03:49.000Z | 2021-12-20T23:55:48.000Z | tests/conftest.py | bpicolo/adjure | 974b4465ea9a827074472410d3013c3b5306b5d2 | [
"MIT"
] | 1 | 2016-06-01T22:02:35.000Z | 2016-06-03T00:08:04.000Z | tests/conftest.py | bpicolo/adjure | 974b4465ea9a827074472410d3013c3b5306b5d2 | [
"MIT"
] | 2 | 2019-02-13T15:33:20.000Z | 2021-06-26T21:57:32.000Z | # -*- coding: utf-8 -*-
import pytest
import staticconf
import staticconf.testing
from adjure.models import base
@pytest.yield_fixture(scope='session', autouse=True)
def mock_configuration():
with staticconf.testing.MockConfiguration(
{
'auth': {
'key_valid_duration': 30,
... | 22.409091 | 55 | 0.608519 |
import pytest
import staticconf
import staticconf.testing
from adjure.models import base
@pytest.yield_fixture(scope='session', autouse=True)
def mock_configuration():
with staticconf.testing.MockConfiguration(
{
'auth': {
'key_valid_duration': 30,
},
},
... | true | true |
1c26d03d730fade00499562dbbf8d509d26349cf | 5,828 | py | Python | huaweicloud-sdk-vpc/huaweicloudsdkvpc/v2/model/vpc_route.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-vpc/huaweicloudsdkvpc/v2/model/vpc_route.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-vpc/huaweicloudsdkvpc/v2/model/vpc_route.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.utils.http_utils import sanitize_for_serialization
class VpcRoute:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attrib... | 23.885246 | 104 | 0.541181 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class VpcRoute:
sensitive_list = []
openapi_types = {
'id': 'str',
'destination': 'str',
'nexthop': 'str',
'type': 'str',
'vpc_id': 'str',
'tenant_id': 'str'... | true | true |
1c26d1d691db4e316d4cc170a781175e1e7b10d2 | 13,446 | py | Python | reagent/gym/tests/test_gym.py | IronOnet/ReAgent | 67434f458cde1f2c946237e866a73392279a7ede | [
"BSD-3-Clause"
] | 2 | 2021-10-31T01:05:46.000Z | 2021-11-08T09:43:25.000Z | reagent/gym/tests/test_gym.py | IronOnet/ReAgent | 67434f458cde1f2c946237e866a73392279a7ede | [
"BSD-3-Clause"
] | null | null | null | reagent/gym/tests/test_gym.py | IronOnet/ReAgent | 67434f458cde1f2c946237e866a73392279a7ede | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import os
import pprint
import unittest
from typing import Optional, Dict, Any
import numpy as np
import pytest
import pytorch_lightning as pl
import torch
from parameterized import parameterized
from reagent.... | 35.10705 | 112 | 0.697828 |
import logging
import os
import pprint
import unittest
from typing import Optional, Dict, Any
import numpy as np
import pytest
import pytorch_lightning as pl
import torch
from parameterized import parameterized
from reagent.core.tensorboardX import summary_writer_context
from reagent.gym.agents.agent import Agent
fr... | true | true |
1c26d2704540eb3121995c085129fb42d94a7597 | 187 | py | Python | popular/loginpage/urls.py | ankush2394/blogsforum1 | f1a9637dee83c685af7e4496b33c84d4c8396ed1 | [
"Apache-2.0"
] | 2 | 2017-11-29T14:34:49.000Z | 2017-11-29T20:15:18.000Z | popular/loginpage/urls.py | ankush2394/blogsforum1 | f1a9637dee83c685af7e4496b33c84d4c8396ed1 | [
"Apache-2.0"
] | null | null | null | popular/loginpage/urls.py | ankush2394/blogsforum1 | f1a9637dee83c685af7e4496b33c84d4c8396ed1 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url,include
from django.contrib import admin
from . import views
app = 'loginpage'
urlpatterns = [
url(r'^$', views.index,name='index'),
] | 18.7 | 42 | 0.657754 | from django.conf.urls import url,include
from django.contrib import admin
from . import views
app = 'loginpage'
urlpatterns = [
url(r'^$', views.index,name='index'),
] | true | true |
1c26d28af80ab80de8d946c836a8c09e4be943bd | 44,621 | py | Python | src/sardana/spock/ipython_01_00/genutils.py | synchrotron-solaris/sardana | caeddcbe2cfe90efa4b8a19bcf6be17b085b3157 | [
"CC-BY-3.0"
] | null | null | null | src/sardana/spock/ipython_01_00/genutils.py | synchrotron-solaris/sardana | caeddcbe2cfe90efa4b8a19bcf6be17b085b3157 | [
"CC-BY-3.0"
] | null | null | null | src/sardana/spock/ipython_01_00/genutils.py | synchrotron-solaris/sardana | caeddcbe2cfe90efa4b8a19bcf6be17b085b3157 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and... | 32.665447 | 145 | 0.601286 |
server_devs = None
for server in server_list:
server_devs = db.get_device_class_list(server)
devs, klasses = server_devs[0::2], server_devs[1::2]
for dev in devs:
if dev.lower() == door_name:
for i, klass in enumerate(klasses):
if klass ... | true | true |
1c26d3d254e7f4794369d6a003698d916f121e81 | 977 | py | Python | mat/mat/modules/ios/dynamic/backups.py | minkione/mat | 8aaec2c9abbc1b837749e5fb084df4665e7ec35c | [
"BSD-3-Clause"
] | null | null | null | mat/mat/modules/ios/dynamic/backups.py | minkione/mat | 8aaec2c9abbc1b837749e5fb084df4665e7ec35c | [
"BSD-3-Clause"
] | null | null | null | mat/mat/modules/ios/dynamic/backups.py | minkione/mat | 8aaec2c9abbc1b837749e5fb084df4665e7ec35c | [
"BSD-3-Clause"
] | 1 | 2019-09-21T16:12:04.000Z | 2019-09-21T16:12:04.000Z | from mat.utils.utils import Utils, Issue
class Issue(Issue):
TITLE = 'File Backup Flag Check'
DESCRIPTION = 'Looks at the files used by the app and their backup flag'
ID = 'permits-backups'
ISSUE_TITLE = 'Application Permits Backups'
FINDINGS = 'The Team found the following file... | 39.08 | 119 | 0.60696 | from mat.utils.utils import Utils, Issue
class Issue(Issue):
TITLE = 'File Backup Flag Check'
DESCRIPTION = 'Looks at the files used by the app and their backup flag'
ID = 'permits-backups'
ISSUE_TITLE = 'Application Permits Backups'
FINDINGS = 'The Team found the following file... | true | true |
1c26d5affd2cae0e427ef94591237e0967761ef3 | 42,819 | py | Python | dataactcore/utils/fileD1.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | dataactcore/utils/fileD1.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | 3 | 2021-08-22T11:47:45.000Z | 2022-03-29T22:06:49.000Z | dataactcore/utils/fileD1.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | from collections import OrderedDict
from sqlalchemy import func, cast, Date
from dataactcore.models.stagingModels import DetachedAwardProcurement
file_model = DetachedAwardProcurement
mapping = OrderedDict([
('detached_award_proc_unique', ['ContractTransactionUniqueKey', 'ContractTransactionUniqueKey ()']),
... | 67.751582 | 120 | 0.697914 | from collections import OrderedDict
from sqlalchemy import func, cast, Date
from dataactcore.models.stagingModels import DetachedAwardProcurement
file_model = DetachedAwardProcurement
mapping = OrderedDict([
('detached_award_proc_unique', ['ContractTransactionUniqueKey', 'ContractTransactionUniqueKey ()']),
... | true | true |
1c26d88e684856dc998063303a33b2625496788f | 2,769 | py | Python | tests/test_bundle.py | iDutchy/SteamStoreFront | b1c0ebb28d049a4b6744ebb3575385db2952a8c9 | [
"MIT"
] | null | null | null | tests/test_bundle.py | iDutchy/SteamStoreFront | b1c0ebb28d049a4b6744ebb3575385db2952a8c9 | [
"MIT"
] | null | null | null | tests/test_bundle.py | iDutchy/SteamStoreFront | b1c0ebb28d049a4b6744ebb3575385db2952a8c9 | [
"MIT"
] | 2 | 2020-03-23T17:19:12.000Z | 2021-06-29T23:08:37.000Z | #!/usr/bin/env python
"""Tests for `steamstorefront` package."""
import pytest
from click.testing import CliRunner
from steamstorefront import SteamStoreFront
from steamstorefront import cli
# Shadow of the Tomb Raider: Definitive Edition
appid = 12231
@pytest.fixture
def app():
data = SteamStoreFront()
r... | 29.147368 | 106 | 0.684001 |
import pytest
from click.testing import CliRunner
from steamstorefront import SteamStoreFront
from steamstorefront import cli
appid = 12231
@pytest.fixture
def app():
data = SteamStoreFront()
return data
def testGetRaw(app):
data = app.getRaw(appid=appid, category='bundle')
assert data['bundle... | true | true |
1c26d8a91307f3d465c8a478cde15ff8e21ed004 | 2,338 | py | Python | twitblocker/__init__.py | galenguyer/TwitBlocker | db3345747b6df373f5acf85369760e31a4ac7931 | [
"MIT"
] | null | null | null | twitblocker/__init__.py | galenguyer/TwitBlocker | db3345747b6df373f5acf85369760e31a4ac7931 | [
"MIT"
] | null | null | null | twitblocker/__init__.py | galenguyer/TwitBlocker | db3345747b6df373f5acf85369760e31a4ac7931 | [
"MIT"
] | null | null | null | """ A small flask Hello World """
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Boolean
import os
import subprocess
import logging
import tweepy
import json
from flask import Flask, jsonify, render_template, send_from_directory
from flask import session, render_template, redirect, url_for
fr... | 30.363636 | 114 | 0.726689 |
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Boolean
import os
import subprocess
import logging
import tweepy
import json
from flask import Flask, jsonify, render_template, send_from_directory
from flask import session, render_template, redirect, url_for
from authlib.integrations.flask_clie... | true | true |
1c26d8b6656c8b44bac69e484ddcbd9e8a34eb5c | 3,003 | py | Python | mainpackage/player.py | qhuy2301/Simple-BlackJack | ab8bf9b20e262c7cc557a9552a11c54f55e0b276 | [
"BSD-3-Clause"
] | null | null | null | mainpackage/player.py | qhuy2301/Simple-BlackJack | ab8bf9b20e262c7cc557a9552a11c54f55e0b276 | [
"BSD-3-Clause"
] | null | null | null | mainpackage/player.py | qhuy2301/Simple-BlackJack | ab8bf9b20e262c7cc557a9552a11c54f55e0b276 | [
"BSD-3-Clause"
] | null | null | null | """Docstring for the player.py module
This module contains the Player class which can be used for creating
multiple Black Jack players.
"""
from deck import VALUES
class Player:
"""
A class to represent players.
Parameters
----------
name : str
Player's name
total_chips : int
... | 25.449153 | 75 | 0.541126 | from deck import VALUES
class Player:
def __init__(self, name, total_chips=0):
self.name = name
self.total_chips = total_chips
self.bet = 0
self.hand = []
self.value = 0
self.aces = 0
def betting(self):
while True:
try:
self... | true | true |
1c26d91cba04d4537bcb0b033228dfa29f3927b9 | 7,923 | py | Python | projects/project1/scripts/plots.py | kcyu1993/ML_course_kyu | 99671281bcf83cbcd75d1c57772bdfdf79d28aff | [
"MIT"
] | null | null | null | projects/project1/scripts/plots.py | kcyu1993/ML_course_kyu | 99671281bcf83cbcd75d1c57772bdfdf79d28aff | [
"MIT"
] | null | null | null | projects/project1/scripts/plots.py | kcyu1993/ML_course_kyu | 99671281bcf83cbcd75d1c57772bdfdf79d28aff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This python file contains various of functions to generate plots.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from helpers import get_plot_path
""" Lab 3 """
def plot_fitted_curve(y, x, weights, ax):
"""plot the fitted curve. x, weight... | 36.680556 | 136 | 0.589802 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from helpers import get_plot_path
def plot_fitted_curve(y, x, weights, ax):
ax.scatter(x, y, color='b', s=12, facecolors='none', edgecolors='r')
xvals = np.arange(min(x) - 0.1, max(x) + 0.1, 0.1)
f = x.dot(weights)... | true | true |
1c26d95a2436cf15054700d26bf8f3c5e870aac8 | 337 | py | Python | blog/admin.py | NecrOctopuS/sensive_website_optimization | a93b2e0db2c96fbf88de25e2518d1dccb21ba6c3 | [
"MIT"
] | null | null | null | blog/admin.py | NecrOctopuS/sensive_website_optimization | a93b2e0db2c96fbf88de25e2518d1dccb21ba6c3 | [
"MIT"
] | 8 | 2020-06-06T00:49:04.000Z | 2022-02-10T09:53:25.000Z | blog/admin.py | NecrOctopuS/sensive_website_optimization | a93b2e0db2c96fbf88de25e2518d1dccb21ba6c3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from blog.models import Post, Tag, Comment
class PostAdmin(admin.ModelAdmin):
raw_id_fields = ('likes', 'tags')
class CommentAdmin(admin.ModelAdmin):
raw_id_fields = ('post', 'author')
admin.site.register(Post, PostAdmin)
admin.site.register(Tag)
admin.site.register(Commen... | 21.0625 | 42 | 0.753709 | from django.contrib import admin
from blog.models import Post, Tag, Comment
class PostAdmin(admin.ModelAdmin):
raw_id_fields = ('likes', 'tags')
class CommentAdmin(admin.ModelAdmin):
raw_id_fields = ('post', 'author')
admin.site.register(Post, PostAdmin)
admin.site.register(Tag)
admin.site.register(Commen... | true | true |
1c26d9736322e21ec59ff5d8f6a6e7b8deae4688 | 3,849 | py | Python | src/vivarium_gates_child_iv_iron/data/builder.py | ihmeuw/vivarium_gates_child_iv_iron | dd89b2161c636e4d03669bd91ba49824dad27a1d | [
"BSD-3-Clause"
] | null | null | null | src/vivarium_gates_child_iv_iron/data/builder.py | ihmeuw/vivarium_gates_child_iv_iron | dd89b2161c636e4d03669bd91ba49824dad27a1d | [
"BSD-3-Clause"
] | 3 | 2022-03-15T18:52:19.000Z | 2022-03-31T17:05:48.000Z | src/vivarium_gates_child_iv_iron/data/builder.py | ihmeuw/vivarium_gates_child_iv_iron | dd89b2161c636e4d03669bd91ba49824dad27a1d | [
"BSD-3-Clause"
] | null | null | null | """Modularized functions for building project data artifacts.
This module is an abstraction around the load portion of our artifact building ETL pipeline.
The intent is to be declarative so it's easy to see what is put into the artifact and how.
Some degree of verbosity/boilerplate is fine in the interest of transpare... | 30.792 | 92 | 0.663809 | from pathlib import Path
from loguru import logger
import pandas as pd
from vivarium.framework.artifact import Artifact, EntityKey
from vivarium_gates_child_iv_iron.constants import data_keys
from vivarium_gates_child_iv_iron.data import loader
def open_artifact(output_path: Path, location: str) -> Artifact:
if... | true | true |
1c26d9969397c92da6aa7b0add2f1a318964a228 | 1,117 | py | Python | sklearn/metrics/setup.py | jlopezNEU/scikit-learn | 593495eebc3c2f2ffdb244036adf57fab707a47d | [
"BSD-3-Clause"
] | 2 | 2022-01-26T21:04:04.000Z | 2022-02-07T02:51:02.000Z | sklearn/metrics/setup.py | jlopezNEU/scikit-learn | 593495eebc3c2f2ffdb244036adf57fab707a47d | [
"BSD-3-Clause"
] | 10 | 2022-02-21T20:10:33.000Z | 2022-03-26T16:31:33.000Z | sklearn/metrics/setup.py | jlopezNEU/scikit-learn | 593495eebc3c2f2ffdb244036adf57fab707a47d | [
"BSD-3-Clause"
] | 1 | 2022-03-07T03:23:04.000Z | 2022-03-07T03:23:04.000Z | import os
import numpy as np
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("metrics", parent_package, top_path)
libraries = []
if os.name == "posix":
libraries.append("m")
config.add_subpackage("_plot")
co... | 24.822222 | 81 | 0.671441 | import os
import numpy as np
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("metrics", parent_package, top_path)
libraries = []
if os.name == "posix":
libraries.append("m")
config.add_subpackage("_plot")
co... | true | true |
1c26daa4976d8c95634ca4fd3a5688eb629616a0 | 152 | py | Python | main.py | thomasrenn37/StockAnalysis | 78f09a40df9756e083303bfff5a16ceaa2016f43 | [
"MIT"
] | null | null | null | main.py | thomasrenn37/StockAnalysis | 78f09a40df9756e083303bfff5a16ceaa2016f43 | [
"MIT"
] | null | null | null | main.py | thomasrenn37/StockAnalysis | 78f09a40df9756e083303bfff5a16ceaa2016f43 | [
"MIT"
] | null | null | null | """
"""
from Client import EtradeClient
def main():
client = EtradeClient()
client.StockQuote("MSFT")
if __name__ == "__main__":
main() | 11.692308 | 31 | 0.625 |
from Client import EtradeClient
def main():
client = EtradeClient()
client.StockQuote("MSFT")
if __name__ == "__main__":
main() | true | true |
1c26dac4a93dc409e5909cc3f25714a39876c5cf | 968 | py | Python | export.py | TeamNightSky/FreeFlowLearning | 5b09361742d90f682a8db2578f4836535d5955bf | [
"Apache-2.0"
] | null | null | null | export.py | TeamNightSky/FreeFlowLearning | 5b09361742d90f682a8db2578f4836535d5955bf | [
"Apache-2.0"
] | null | null | null | export.py | TeamNightSky/FreeFlowLearning | 5b09361742d90f682a8db2578f4836535d5955bf | [
"Apache-2.0"
] | null | null | null | import PyInstaller.__main__
import os
NAME = 'FreeFlowLearning'
BUILD_DIR = os.path.join(os.getcwd(), 'build')
DIST_PATH = os.path.join(os.getcwd(), 'binaries')
resource_args = [
*['--add-binary=%s:.' % os.path.join(NAME, 'Frontend','static', 'img', file) for file in os.listdir(os.path.join(NAME, 'Frontend','sta... | 30.25 | 153 | 0.61157 | import PyInstaller.__main__
import os
NAME = 'FreeFlowLearning'
BUILD_DIR = os.path.join(os.getcwd(), 'build')
DIST_PATH = os.path.join(os.getcwd(), 'binaries')
resource_args = [
*['--add-binary=%s:.' % os.path.join(NAME, 'Frontend','static', 'img', file) for file in os.listdir(os.path.join(NAME, 'Frontend','sta... | true | true |
1c26dcd40f9de2eb5f4a2636ed587c2cb4af9edf | 627 | py | Python | venv/bin/rst2xml.py | pd-Shah/FlaskRecycle | 54060aa5c0eacefc0874ea01cbe6545000b416e0 | [
"MIT"
] | 1 | 2022-03-18T19:25:55.000Z | 2022-03-18T19:25:55.000Z | venv/bin/rst2xml.py | pd-Shah/FlaskRecycle | 54060aa5c0eacefc0874ea01cbe6545000b416e0 | [
"MIT"
] | null | null | null | venv/bin/rst2xml.py | pd-Shah/FlaskRecycle | 54060aa5c0eacefc0874ea01cbe6545000b416e0 | [
"MIT"
] | null | null | null | #!/home/pd/Gits/recycl.org/venv/bin/python3
# $Id: rst2xml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing Docutils XML.
"""
try:
import locale
local... | 26.125 | 70 | 0.738437 |
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline, default_description
description = ('Generates Docutils-native XML from standalone '
'reStructuredText sources. ' + default_description)
publish_cmdline(writer_name='xml',... | true | true |
1c26df725f146b6b20b6a0909935c9f01890a63d | 1,303 | py | Python | layers/loss_funcs.py | hailusong/mrc-for-flat-nested-ner | 8e6f023c0d099f689f001817cf0644978c3ed22d | [
"Apache-2.0"
] | 41 | 2020-01-21T03:48:57.000Z | 2022-02-21T09:55:20.000Z | layers/loss_funcs.py | hailusong/mrc-for-flat-nested-ner | 8e6f023c0d099f689f001817cf0644978c3ed22d | [
"Apache-2.0"
] | null | null | null | layers/loss_funcs.py | hailusong/mrc-for-flat-nested-ner | 8e6f023c0d099f689f001817cf0644978c3ed22d | [
"Apache-2.0"
] | 12 | 2019-12-15T11:53:13.000Z | 2021-08-09T02:59:54.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Xiaoy LI
# Last update: 2019.03.23
# First create: 2019.03.23
# Description:
# loss_funcs_examples.py
import os
import sys
import numpy as np
root_path = "/".join(os.path.realpath(__file__).split("/")[:-2])
if root_path not in sys.path:
sys.pa... | 21.360656 | 79 | 0.644666 |
import os
import sys
import numpy as np
root_path = "/".join(os.path.realpath(__file__).split("/")[:-2])
if root_path not in sys.path:
sys.path.insert(0, root_path)
import torch
import torch.nn as nn
from torch.nn import BCEWithLogitsLoss
def nll_loss():
input = torch.randn(3, 5, ... | true | true |
1c26e029198ec54cdb60fbc9907d2b90fc0bd68e | 1,864 | py | Python | ansible/playbooks/network/scripts/net-ios-show-telnet-msg-slack.py | aegiacometti/pychatops-basic | 44525fb1f4b114d12c6b6d0777690e7757afbcd5 | [
"Apache-2.0"
] | 3 | 2020-11-04T00:40:18.000Z | 2021-01-15T08:27:56.000Z | ansible/playbooks/network/scripts/net-ios-show-telnet-msg-slack.py | aegiacometti/pychatops-basic | 44525fb1f4b114d12c6b6d0777690e7757afbcd5 | [
"Apache-2.0"
] | null | null | null | ansible/playbooks/network/scripts/net-ios-show-telnet-msg-slack.py | aegiacometti/pychatops-basic | 44525fb1f4b114d12c6b6d0777690e7757afbcd5 | [
"Apache-2.0"
] | null | null | null | import configparser
import os
import sys
import json
from slackclient import SlackClient
from pychatops.slack.common import log_ops
from pychatops.slack.common import slack_ops
script_name = os.path.basename(__file__)
# print("sys.argv= " + str(sys.argv))
source = sys.argv[1]
channel = sys.argv[2]
username = sys.a... | 31.066667 | 99 | 0.683476 | import configparser
import os
import sys
import json
from slackclient import SlackClient
from pychatops.slack.common import log_ops
from pychatops.slack.common import slack_ops
script_name = os.path.basename(__file__)
source = sys.argv[1]
channel = sys.argv[2]
username = sys.argv[3]
bot_name = sys.argv[4]
task_id... | true | true |
1c26e032e96247ddedd30104f7153952f899980c | 38,043 | py | Python | youtube_api/youtube_api.py | jklwonder/youtube-data-api | 85e90e38f2848cdb68e05cb7935307c03543bf99 | [
"MIT"
] | null | null | null | youtube_api/youtube_api.py | jklwonder/youtube-data-api | 85e90e38f2848cdb68e05cb7935307c03543bf99 | [
"MIT"
] | null | null | null | youtube_api/youtube_api.py | jklwonder/youtube-data-api | 85e90e38f2848cdb68e05cb7935307c03543bf99 | [
"MIT"
] | null | null | null | import time
import requests
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
import datetime
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
from pytube import You... | 47.85283 | 327 | 0.588361 | import time
import requests
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
import datetime
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
from pytube import You... | true | true |
1c26e0a0d78e80e8e4ca475369832055b396e4eb | 2,014 | py | Python | test/functional/p2p_invalid_locator.py | wizadr/ocvcoin | 449d29249a7469c523ce620d67f880d31a4d4486 | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_locator.py | wizadr/ocvcoin | 449d29249a7469c523ce620d67f880d31a4d4486 | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_locator.py | wizadr/ocvcoin | 449d29249a7469c523ce620d67f880d31a4d4486 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Ocvcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid locators.
"""
from test_framework.messages import msg_getheaders, msg_g... | 45.772727 | 135 | 0.696127 |
from test_framework.messages import msg_getheaders, msg_getblocks, MAX_LOCATOR_SZ
from test_framework.p2p import P2PInterface
from test_framework.test_framework import OcvcoinTestFramework
class InvalidLocatorTest(OcvcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup... | true | true |
1c26e0b3a45e40bcf0dcd144188274031403dba7 | 7,173 | py | Python | codes/ONNet/case_brain.py | azopticsinc/optical-neural-network | 28280014a6c1fc717a5077ed5e3c3496a4b103ac | [
"MIT"
] | 1 | 2021-04-27T00:50:12.000Z | 2021-04-27T00:50:12.000Z | codes/ONNet/case_brain.py | dalerxli/optical-neural-networks-1 | 28280014a6c1fc717a5077ed5e3c3496a4b103ac | [
"MIT"
] | null | null | null | codes/ONNet/case_brain.py | dalerxli/optical-neural-networks-1 | 28280014a6c1fc717a5077ed5e3c3496a4b103ac | [
"MIT"
] | 1 | 2021-08-14T02:31:06.000Z | 2021-08-14T02:31:06.000Z | '''
@Author: Yingshi Chen
@Date: 2020-04-08 17:12:34
@
# Description:
'''
import torch
from torch.utils.data import Dataset
from torchvision.transforms import ToPILImage
import os
import math
import hdf5storage
from enum import Enum
import re
from torchvision.transforms import transforms
import cv2
import numpy as np... | 34.320574 | 123 | 0.571867 | import torch
from torch.utils.data import Dataset
from torchvision.transforms import ToPILImage
import os
import math
import hdf5storage
from enum import Enum
import re
from torchvision.transforms import transforms
import cv2
import numpy as np
def get_data_if_needed(data_path='./data/', url="https://ndownloader.figsh... | true | true |
1c26e0cab2f8b1043315933e84aa8e78558225a4 | 57,436 | py | Python | local/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py | sahilsdei/django_ecommerce | edc2513e41aca178d1ccae14ebaa6c7b1d709e73 | [
"MIT"
] | null | null | null | local/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py | sahilsdei/django_ecommerce | edc2513e41aca178d1ccae14ebaa6c7b1d709e73 | [
"MIT"
] | null | null | null | local/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py | sahilsdei/django_ecommerce | edc2513e41aca178d1ccae14ebaa6c7b1d709e73 | [
"MIT"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import simplejson... | 36.513668 | 79 | 0.514242 | peIdent
app.jinja_env.filters['hasAny'] = has_any
super(ServerModule, self).register(app, options, first_registration)
def register_preferences(self):
ServerType.register_preferences()
def get_exposed_url_endpoints(self):
return ['NODE-server.connect_id']
class Serv... | true | true |
1c26e0e3b54fda90518de8b4c886b55918046d27 | 205 | py | Python | exmlc/metrics/__init__.py | LennartKeller/exmlc | 912d51451a448b5d56bfe921bfdaaea82c7b7084 | [
"Apache-2.0"
] | 1 | 2020-04-03T08:10:42.000Z | 2020-04-03T08:10:42.000Z | exmlc/metrics/__init__.py | LennartKeller/exmlc | 912d51451a448b5d56bfe921bfdaaea82c7b7084 | [
"Apache-2.0"
] | null | null | null | exmlc/metrics/__init__.py | LennartKeller/exmlc | 912d51451a448b5d56bfe921bfdaaea82c7b7084 | [
"Apache-2.0"
] | null | null | null | from .dcg import average_discounted_cumulative_gain_at_k
from .extreme_multilabel_classification_report import extreme_multilabel_classification_report
from .precision import sparse_average_precision_at_k
| 51.25 | 94 | 0.926829 | from .dcg import average_discounted_cumulative_gain_at_k
from .extreme_multilabel_classification_report import extreme_multilabel_classification_report
from .precision import sparse_average_precision_at_k
| true | true |
1c26e1172d2c006e98905fd976fa7a0732ce48e3 | 1,975 | py | Python | test/test_atlascluster.py | ozlevka-work/MongoDB-Atlas-API | 781221653ea3956243c03670ab50a5308390a76f | [
"Apache-2.0"
] | null | null | null | test/test_atlascluster.py | ozlevka-work/MongoDB-Atlas-API | 781221653ea3956243c03670ab50a5308390a76f | [
"Apache-2.0"
] | null | null | null | test/test_atlascluster.py | ozlevka-work/MongoDB-Atlas-API | 781221653ea3956243c03670ab50a5308390a76f | [
"Apache-2.0"
] | null | null | null | import unittest
import pprint
import random
import string
from mongodbatlas.atlascluster import AtlasCluster
from mongodbatlas.atlasresource import AtlasResource
from mongodbatlas.atlasrequests import AtlasRequests
from mongodbatlas.atlasapi import AtlasAPI
class MyTestCase(unittest.TestCase):
def setUp(self):
... | 38.72549 | 95 | 0.654177 | import unittest
import pprint
import random
import string
from mongodbatlas.atlascluster import AtlasCluster
from mongodbatlas.atlasresource import AtlasResource
from mongodbatlas.atlasrequests import AtlasRequests
from mongodbatlas.atlasapi import AtlasAPI
class MyTestCase(unittest.TestCase):
def setUp(self):
... | true | true |
1c26e211bbfe8d45fefcfdba208a5886b996fcbb | 4,727 | py | Python | src/olympia/amo/celery.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/celery.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/celery.py | gijsk/addons-server | 7c38f379e3a0b4a5ca231f98ac0c049450c224bd | [
"BSD-3-Clause"
] | null | null | null | """Loads and instantiates Celery, registers our tasks, and performs any other
necessary Celery-related setup. Also provides Celery-related utility methods,
in particular exposing a shortcut to the @task decorator."""
from __future__ import absolute_import
import datetime
from django.conf import settings
from django.c... | 33.055944 | 78 | 0.682039 | from __future__ import absolute_import
import datetime
from django.conf import settings
from django.core.cache import cache
import waffle
from celery import Celery, group
from celery.signals import task_failure, task_postrun, task_prerun
from django_statsd.clients import statsd
from post_request_task.task import Po... | true | true |
1c26e2b3feadf3262cffe3108bcc4de9739ee708 | 565 | py | Python | Python3/0531-Lonely-Pixel-I/soln-1.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0531-Lonely-Pixel-I/soln-1.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0531-Lonely-Pixel-I/soln-1.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def findLonelyPixel(self, picture: List[List[str]]) -> int:
m, n = len(picture), len(picture[0])
rows, cols = [0] * m, [0] * n
for i, row in enumerate(picture):
for j, pixel in enumerate(row):
if pixel == 'B':
rows[i] += 1
... | 35.3125 | 66 | 0.442478 | class Solution:
def findLonelyPixel(self, picture: List[List[str]]) -> int:
m, n = len(picture), len(picture[0])
rows, cols = [0] * m, [0] * n
for i, row in enumerate(picture):
for j, pixel in enumerate(row):
if pixel == 'B':
rows[i] += 1
... | true | true |
1c26e2d3f99b89b391ee7fe96bd42c5e4cbb2833 | 1,549 | py | Python | samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py | Ronak06/python-tasks | d34d8f871f5c88771320d9a1a6caf4be15b89911 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py | Ronak06/python-tasks | d34d8f871f5c88771320d9a1a6caf4be15b89911 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py | Ronak06/python-tasks | d34d8f871f5c88771320d9a1a6caf4be15b89911 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 32.957447 | 85 | 0.762427 |
from google.cloud import tasks_v2
def sample_test_iam_permissions():
client = tasks_v2.CloudTasksClient()
request = tasks_v2.TestIamPermissionsRequest(
resource="resource_value",
permissions=['permissions_value_1', 'permissions_value_2'],
)
re... | true | true |
1c26e2dcb56652979899e92d7ba22adc7009cad0 | 2,422 | py | Python | src/pyeiote/device_profiles/streaming.py | ckoroscil/pyeiote | 6340f773fe19fb038d78e0c15b6d6e4e79985c7f | [
"MIT"
] | null | null | null | src/pyeiote/device_profiles/streaming.py | ckoroscil/pyeiote | 6340f773fe19fb038d78e0c15b6d6e4e79985c7f | [
"MIT"
] | null | null | null | src/pyeiote/device_profiles/streaming.py | ckoroscil/pyeiote | 6340f773fe19fb038d78e0c15b6d6e4e79985c7f | [
"MIT"
] | null | null | null | from .base import BaseDevice
import uuid
import random
default_protocol_config = {
"protocol_config": [{
"MDNS": {
"frequency": 1
}
}]
}
roku_protocol_config = {
"mac": "b0:ee:7b",
"uuid": str(uuid.uuid1()),
"protocol_config": [{
"mdns": {
"frequency... | 28.833333 | 68 | 0.371594 | from .base import BaseDevice
import uuid
import random
default_protocol_config = {
"protocol_config": [{
"MDNS": {
"frequency": 1
}
}]
}
roku_protocol_config = {
"mac": "b0:ee:7b",
"uuid": str(uuid.uuid1()),
"protocol_config": [{
"mdns": {
"frequency... | true | true |
1c26e31cf79f71d6dc6c7e8f2d731cb5c7ca5764 | 910 | py | Python | CheapestFight.py | bulaimei1991/MyLeetcode | a88a9b917f23c455f68d668968c07f5e5960e875 | [
"Apache-2.0"
] | null | null | null | CheapestFight.py | bulaimei1991/MyLeetcode | a88a9b917f23c455f68d668968c07f5e5960e875 | [
"Apache-2.0"
] | null | null | null | CheapestFight.py | bulaimei1991/MyLeetcode | a88a9b917f23c455f68d668968c07f5e5960e875 | [
"Apache-2.0"
] | null | null | null | # -*- coding=utf-8 -*-
'''
有 n 个城市通过 m 个航班连接。每个航班都从城市 u 开始,以价格 w 抵达 v。
现在给定所有的城市和航班,以及出发城市 src 和目的地 dst,你的任务是找到从 src 到 dst 最多经过 k 站中转的最便宜的价格。 如果没有这样的路线,则输出 -1。
示例 1:
输入:
n = 3, edges = [[0,1,100],[1,2,100],[0,2,500]]
src = 0, dst = 2, k = 1
输出: 200
n 范围是 [1, 100],城市标签从 0 到 n - 1.
航班数量范围是 [0, n * (n - 1) / 2].
每个航班的格... | 17.5 | 88 | 0.525275 |
class Solution(object):
def findCheapestPrice(self, n, flights, src, dst, K):
if src==dst:
return 0
Cheapest=[-1 for i in range(0,n)]
for i in range(0,k):
pass
n=4
edges=[[0,1,100],[1,2,100],[0,2,500],[0,3,200],[2,3,400]]
src=1
dst=3
k=2
| true | true |
1c26e3701bc416bb447a01c05bee69c5b9b6dd3c | 1,961 | py | Python | tensorflow_data_validation/utils/bin_util_test.py | hephaex/data-validation | 21543a6896e4630aeb8b569e79e7a7cc03a3c565 | [
"Apache-2.0"
] | 621 | 2018-09-10T19:27:18.000Z | 2022-03-31T06:43:24.000Z | tensorflow_data_validation/utils/bin_util_test.py | hephaex/data-validation | 21543a6896e4630aeb8b569e79e7a7cc03a3c565 | [
"Apache-2.0"
] | 157 | 2018-09-10T08:53:18.000Z | 2022-03-31T14:07:51.000Z | tensorflow_data_validation/utils/bin_util_test.py | hephaex/data-validation | 21543a6896e4630aeb8b569e79e7a7cc03a3c565 | [
"Apache-2.0"
] | 141 | 2018-09-10T06:38:13.000Z | 2022-03-31T07:27:16.000Z | # Copyright 2019 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, ... | 36.314815 | 79 | 0.660377 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
from absl.testing import parameterized
import numpy as np
import pyarrow as pa
from tensorflow_data_validation.utils import bin_util
class BinArrayTest(parame... | true | true |
1c26e4d75b7055c24678c88303f51a78cf0528f4 | 6,226 | py | Python | extensions/interact.py | ggoncalopereira/JBB.py | e66419466cc6d35e134cceb8c8ad48102556658b | [
"MIT"
] | 22 | 2018-08-27T17:15:18.000Z | 2021-03-13T20:43:37.000Z | extensions/interact.py | ggoncalopereira/JBB.py | e66419466cc6d35e134cceb8c8ad48102556658b | [
"MIT"
] | 26 | 2018-09-21T19:55:13.000Z | 2022-02-24T03:41:37.000Z | extensions/interact.py | ggoncalopereira/JBB.py | e66419466cc6d35e134cceb8c8ad48102556658b | [
"MIT"
] | 39 | 2018-09-21T19:42:09.000Z | 2020-12-30T04:58:59.000Z | import discord
from discord.ext import commands
import json
import subprocess
from random import randint
class Interact(commands.Cog):
"""Interact with other users while pinging them"""
def __init__(self, bot):
self.bot = bot
@commands.command(name='hug',
description=... | 38.670807 | 139 | 0.525377 | import discord
from discord.ext import commands
import json
import subprocess
from random import randint
class Interact(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='hug',
description="hug somenone you love",
brief="hug s... | true | true |
1c26e4ecaa4d471e06389e1bc6ba232d4bdc032f | 693 | py | Python | Python_exercises/ex19.py | StephenTanksley/Python_THW | 0cf34d29cd8c6961385fc2da17ec64edd43c00e9 | [
"MIT"
] | 1 | 2020-05-21T23:20:14.000Z | 2020-05-21T23:20:14.000Z | Python_exercises/ex19.py | StephenTanksley/Python_THW | 0cf34d29cd8c6961385fc2da17ec64edd43c00e9 | [
"MIT"
] | null | null | null | Python_exercises/ex19.py | StephenTanksley/Python_THW | 0cf34d29cd8c6961385fc2da17ec64edd43c00e9 | [
"MIT"
] | null | null | null | def cheese_and_crackers(cheese_count, boxes_of_crackers):
print(f"You have {cheese_count} cheeses!")
print(f"You have {boxes_of_crackers} boxes of crackers!")
print("Man, that's enough for a party!")
print("Get a blanket.\n")
print("We can just give the function numbers directly:")
cheese_and_crackers... | 31.5 | 70 | 0.756133 | def cheese_and_crackers(cheese_count, boxes_of_crackers):
print(f"You have {cheese_count} cheeses!")
print(f"You have {boxes_of_crackers} boxes of crackers!")
print("Man, that's enough for a party!")
print("Get a blanket.\n")
print("We can just give the function numbers directly:")
cheese_and_crackers... | true | true |
1c26e6ab67cbb8f66ae6afe757313c91cb8bd1ea | 1,039 | py | Python | students/K33402/Puzyrev_Dmitry/practical_works/simple_drf_project/warriors/serializers.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 4 | 2020-09-03T15:41:42.000Z | 2021-12-24T15:28:20.000Z | students/K33402/Puzyrev_Dmitry/practical_works/simple_drf_project/warriors/serializers.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 48 | 2020-09-13T20:22:42.000Z | 2021-04-30T11:13:30.000Z | students/K33402/Puzyrev_Dmitry/practical_works/simple_drf_project/warriors/serializers.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 69 | 2020-09-06T10:32:37.000Z | 2021-11-28T18:13:17.000Z | from rest_framework import serializers
from .models import *
class WarriorSerializer(serializers.ModelSerializer):
class Meta:
model = Warrior
fields = ['name']
class WarriorRelatedSerializer(serializers.ModelSerializer):
skill = serializers.StringRelatedField(read_only=True, many=True)
class Meta:
... | 24.738095 | 73 | 0.751684 | from rest_framework import serializers
from .models import *
class WarriorSerializer(serializers.ModelSerializer):
class Meta:
model = Warrior
fields = ['name']
class WarriorRelatedSerializer(serializers.ModelSerializer):
skill = serializers.StringRelatedField(read_only=True, many=True)
class Meta:
... | true | true |
1c26e808e7f4d04a995da917d8f6d570fb87587f | 2,253 | py | Python | tests/test_visitors/test_ast/test_conditions/test_implicit_in.py | NickVolynkin/wemake-python-styleguide | 7ae76b029a6ac55499120686c2fd21a6ed186bbe | [
"MIT"
] | null | null | null | tests/test_visitors/test_ast/test_conditions/test_implicit_in.py | NickVolynkin/wemake-python-styleguide | 7ae76b029a6ac55499120686c2fd21a6ed186bbe | [
"MIT"
] | null | null | null | tests/test_visitors/test_ast/test_conditions/test_implicit_in.py | NickVolynkin/wemake-python-styleguide | 7ae76b029a6ac55499120686c2fd21a6ed186bbe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.refactoring import (
ImplicitInConditionViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import (
ImplicitBoolPatternsVisitor,
)
# Correct:
eq_and = '{0} == some1 and {1} == some2'
noteq_or = '{0} != some1 or {1... | 21.457143 | 69 | 0.63826 |
import pytest
from wemake_python_styleguide.violations.refactoring import (
ImplicitInConditionViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import (
ImplicitBoolPatternsVisitor,
)
eq_and = '{0} == some1 and {1} == some2'
noteq_or = '{0} != some1 or {1} != some2'
eq_or = '{0} == so... | true | true |
1c26e81db5b293a98005ce326886ab764b681745 | 12,039 | py | Python | SCRAPE/Lib/site-packages/scrapy/exporters.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2019-09-16T12:22:36.000Z | 2019-09-16T12:22:36.000Z | SCRAPE/Lib/site-packages/scrapy/exporters.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2021-09-20T19:54:42.000Z | 2021-09-20T19:54:42.000Z | SCRAPE/Lib/site-packages/scrapy/exporters.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 1 | 2022-03-17T17:21:11.000Z | 2022-03-17T17:21:11.000Z | """
Item Exporters are used to export/serialize items into different formats.
"""
import csv
import io
import marshal
import pickle
import pprint
import warnings
from xml.sax.saxutils import XMLGenerator
from itemadapter import is_item, ItemAdapter
from scrapy.exceptions import ScrapyDeprecationWarning
from scrapy.i... | 35.513274 | 101 | 0.644489 |
import csv
import io
import marshal
import pickle
import pprint
import warnings
from xml.sax.saxutils import XMLGenerator
from itemadapter import is_item, ItemAdapter
from scrapy.exceptions import ScrapyDeprecationWarning
from scrapy.item import Item
from scrapy.utils.python import is_listlike, to_bytes, to_unicode
... | true | true |
1c26e95a2b208c72bf36f1f1c2307d6821862a70 | 1,697 | py | Python | example/src/node/ping_node.py | FreNeS1/PyEngy-2d | 771112530ae039e8921369f700ba3b66c3df50c1 | [
"MIT"
] | 1 | 2020-07-09T12:42:30.000Z | 2020-07-09T12:42:30.000Z | example/src/node/ping_node.py | FreNeS1/PyEngy-2d | 771112530ae039e8921369f700ba3b66c3df50c1 | [
"MIT"
] | null | null | null | example/src/node/ping_node.py | FreNeS1/PyEngy-2d | 771112530ae039e8921369f700ba3b66c3df50c1 | [
"MIT"
] | null | null | null | """Contains the Node class."""
from typing import Optional, List
from pyengy.node import Node
from pyengy.util import Context
class PingNode(Node):
"""
Example custom node that pings to the logger periodically. Instead of storing the accumulated value locally it uses
the context of the application."""
... | 40.404762 | 119 | 0.66647 |
from typing import Optional, List
from pyengy.node import Node
from pyengy.util import Context
class PingNode(Node):
def __init__(self, name: str, ping_time: int = 1000, parent: Optional[Node] = None,
children: Optional[List[Node]] = None):
super().__init__(name, parent=parent, childre... | true | true |
1c26e9861dff755af9ff2cc5ed88c0cd824ce0e4 | 6,672 | py | Python | Scripts/simulation/sims/sim_info_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/sim_info_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/sim_info_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\sim_info_interactions.py
# Compiled at: 2020-09-08 20:37:08
# Size of source mod 2**32: 8799 by... | 49.791045 | 212 | 0.667116 |
from event_testing.resolver import SingleSimResolver
from event_testing.results import TestResult
from event_testing.tests import TunableTestSet
from interactions import ParticipantType
from interactions.base.immediate_interaction import ImmediateSuperInteraction
from sims4.tuning.instances import lock_instance_t... | true | true |
1c26e9c2ab32b60ac740e782f03519aee81f3ddc | 3,157 | py | Python | examples/00-load/create-tri-surface.py | eino/pyvista | b9c4e67d43491958f70b04cd2664965b938910ba | [
"MIT"
] | 25 | 2018-12-03T18:22:58.000Z | 2019-02-26T01:30:35.000Z | examples/00-load/create-tri-surface.py | eino/pyvista | b9c4e67d43491958f70b04cd2664965b938910ba | [
"MIT"
] | 108 | 2019-02-27T19:52:12.000Z | 2019-05-08T02:15:21.000Z | examples/00-load/create-tri-surface.py | eino/pyvista | b9c4e67d43491958f70b04cd2664965b938910ba | [
"MIT"
] | 8 | 2019-03-02T13:41:48.000Z | 2019-04-22T16:57:44.000Z | """
.. _triangulated_surface:
Create Triangulated Surface
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a surface from a set of points through a Delaunay triangulation.
"""
import numpy as np
# sphinx_gallery_thumbnail_number = 2
import pyvista as pv
###########################################################################... | 32.546392 | 89 | 0.571429 |
import numpy as np
import pyvista as pv
| true | true |
1c26ec4ae933d07f3c95e9f214a23e14d668a682 | 3,843 | py | Python | aliyun-python-sdk-r-kvstore/aliyunsdkr_kvstore/request/v20150101/DescribeAvailableResourceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-r-kvstore/aliyunsdkr_kvstore/request/v20150101/DescribeAvailableResourceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-r-kvstore/aliyunsdkr_kvstore/request/v20150101/DescribeAvailableResourceRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.12931 | 93 | 0.770752 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkr_kvstore.endpoint import endpoint_data
class DescribeAvailableResourceRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'R-kvstore', '2015-01-01', 'DescribeAvailableResource','redisa')
self.set_method('POST')
if ha... | true | true |
1c26ed04c99cf37535c8fb4a51c75066656c6ad0 | 37,511 | py | Python | fbx.py | SergeyMakeev/RobloxAvatarExporter | 8bf9a90810caa2c25f46bd8ba05551d5c475aefe | [
"MIT"
] | 3 | 2021-12-06T20:01:43.000Z | 2021-12-09T04:29:54.000Z | fbx.py | SergeyMakeev/RobloxAvatarExporter | 8bf9a90810caa2c25f46bd8ba05551d5c475aefe | [
"MIT"
] | null | null | null | fbx.py | SergeyMakeev/RobloxAvatarExporter | 8bf9a90810caa2c25f46bd8ba05551d5c475aefe | [
"MIT"
] | 1 | 2021-12-06T19:55:32.000Z | 2021-12-06T19:55:32.000Z | # The MIT License (MIT)
#
# Copyright (c) 2019 Sergey Makeev
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | 49.881649 | 119 | 0.53531 |
import uuid
import datetime
def normalize_file_path(path):
path = path.replace('\\', '/')
while path.find('//') >= 0:
path = path.replace('//', '/')
return path
def get_filename_without_ext(path):
path = normalize_file_path(path)
prefix_index = path.rfind('/')
... | true | true |
1c26ed42183890168f97fc7a620f287da098f4d2 | 111,151 | py | Python | neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 46.643307 | 79 | 0.580058 |
import base64
import collections
import functools
import hashlib
import signal
import sys
import time
import netaddr
from neutron_lib.agent import constants as agent_consts
from neutron_lib.agent import topics
from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events ... | true | true |
1c26ed63e089e662bac5030d2627e45887d3a43a | 3,578 | py | Python | ask-sdk-model/ask_sdk_model/interfaces/system/error.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | 2 | 2021-10-30T06:52:48.000Z | 2021-11-16T12:34:16.000Z | ask-sdk-model/ask_sdk_model/interfaces/system/error.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | ask-sdk-model/ask_sdk_model/interfaces/system/error.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 31.113043 | 96 | 0.588597 |
import pprint
import re
import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
from ask_sdk_model.interfaces.system.error_type import ErrorType
class Error(object):
deserialized_types = {
... | true | true |
1c26edb404fc4e90272252ed40d41c4719d14cd8 | 2,098 | py | Python | RoadCrackSegmentation/get_plot.py | ForrestPi/DefectDetection | 7e999335ffbd50519cdfaba7de0d6bfa306a579a | [
"Unlicense"
] | 4 | 2020-06-03T08:10:13.000Z | 2021-06-11T09:46:48.000Z | RoadCrackSegmentation/get_plot.py | ForrestPi/DefectDetection | 7e999335ffbd50519cdfaba7de0d6bfa306a579a | [
"Unlicense"
] | null | null | null | RoadCrackSegmentation/get_plot.py | ForrestPi/DefectDetection | 7e999335ffbd50519cdfaba7de0d6bfa306a579a | [
"Unlicense"
] | 1 | 2020-04-14T08:28:04.000Z | 2020-04-14T08:28:04.000Z | # -*- coding: UTF-8 -*-
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
def get_loss_list(model):
dir = os.path.join('checkpoint', model)
files = os.listdir(dir)
sorted(files)
index =[]
losses = []
acc =[]
for i,x in enumerate(files):
index.app... | 24.114943 | 72 | 0.602479 |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
def get_loss_list(model):
dir = os.path.join('checkpoint', model)
files = os.listdir(dir)
sorted(files)
index =[]
losses = []
acc =[]
for i,x in enumerate(files):
index.append(i)
losses.a... | true | true |
1c26ee017de85d16d39ed0addb02726fbdc9e4f6 | 593 | py | Python | env/Lib/site-packages/plotly/validators/scatter3d/marker/line/_color.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/scatter3d/marker/line/_color.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/scatter3d/marker/line/_color.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter3d.marker.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | 32.944444 | 80 | 0.62226 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter3d.marker.line", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | true | true |
1c26ee5e22f73270a35ad525bf999848ebe85681 | 2,655 | py | Python | python/pyarrow/util.py | ejconlon/arrow | b3cd616f6ce39e9a820b658ba2f2e2fd3b153555 | [
"Apache-2.0"
] | 3 | 2018-11-19T13:38:21.000Z | 2019-08-28T14:56:37.000Z | python/pyarrow/util.py | ejconlon/arrow | b3cd616f6ce39e9a820b658ba2f2e2fd3b153555 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/util.py | ejconlon/arrow | b3cd616f6ce39e9a820b658ba2f2e2fd3b153555 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.235294 | 78 | 0.689642 |
import six
import warnings
try:
try:
import pathlib
except ImportError:
import pathlib2 as pathlib
_has_pathlib = True
except ImportError:
_has_pathlib = False
def implements(f):
def decorator(g):
g.__doc__ = f.__doc__
return g
return ... | true | true |
1c26ef461368c9419cb28ca6e2496ff106dab293 | 8,078 | py | Python | main.py | shiyuecamusz/LollipopKitu | a3719a1d79aac84721f6b2cddd32c52f00239379 | [
"MIT"
] | 8 | 2020-05-09T01:52:07.000Z | 2021-03-11T00:22:35.000Z | main.py | 982594419/ChaoXingAutoSign | e822daf16373352520d6f2ce851d0330c4eed1c1 | [
"MIT"
] | null | null | null | main.py | 982594419/ChaoXingAutoSign | e822daf16373352520d6f2ce851d0330c4eed1c1 | [
"MIT"
] | 6 | 2020-05-09T02:36:51.000Z | 2022-01-06T02:56:30.000Z | # -*- coding:utf-8 -*-
import multiprocessing
import random
from datetime import datetime, time
from time import sleep
from time import time as times
import os
from urllib import parse
import json
import requests
# !!!请填写下面的参数
# 填写用户名和密码,以便登录
username = ''
password = ''
# uid为用户id
uid = ''
# 此三项为签到参数,经纬度和真实姓名
latitud... | 32.183267 | 114 | 0.508418 |
import multiprocessing
import random
from datetime import datetime, time
from time import sleep
from time import time as times
import os
from urllib import parse
import json
import requests
username = ''
password = ''
uid = ''
latitude = '-1'
longitude = '-1'
name = ''
clientip = ''
signuseragent = ''
objectId... | true | true |
1c26ef4acfde45b97044a4a84ba109f08307acb3 | 7,702 | py | Python | nipype/interfaces/dynamic_slicer.py | demianw/nipype | 52d64c30d96ecd94f1833156e28dce32c4f05ebe | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/dynamic_slicer.py | demianw/nipype | 52d64c30d96ecd94f1833156e28dce32c4f05ebe | [
"BSD-3-Clause"
] | 2 | 2017-10-05T21:08:38.000Z | 2018-10-09T23:01:23.000Z | nipype/interfaces/dynamic_slicer.py | effigies/nipype | 18fe222557cf3b9627e06b2a66fba589feaca581 | [
"Apache-2.0"
] | 1 | 2016-10-11T19:18:53.000Z | 2016-10-11T19:18:53.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import warnings
import xml.dom.minidom
from nipype.interfaces.base import (CommandLine, CommandLineInputSpec,
DynamicTraitedSpec, traits, Undefined,
... | 45.040936 | 192 | 0.603869 |
import os
import warnings
import xml.dom.minidom
from nipype.interfaces.base import (CommandLine, CommandLineInputSpec,
DynamicTraitedSpec, traits, Undefined,
File, isdefined)
class SlicerCommandLineInputSpec(DynamicTraitedSpec, CommandLineInp... | true | true |
1c26f17d2185eda40065447ee1354e5564503292 | 643 | py | Python | keras_malicious_url_detector/library/utility/url_data_loader.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | keras_malicious_url_detector/library/utility/url_data_loader.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | keras_malicious_url_detector/library/utility/url_data_loader.py | Adrimeov/keras-malicious-url-detector | 22b8d075b41117f016100bb5ebff14a77907dacb | [
"MIT"
] | null | null | null | import pandas as pd
import os
def load_url_data(data_dir_path):
url_data = pd.read_csv(data_dir_path, sep=',')
url_data.columns = ['text', 'label']
class_zero = url_data[url_data['label'] == 0].reset_index()
class_one = url_data[url_data['label'] == 1].reset_index()
class_zero = class_zero.trun... | 21.433333 | 72 | 0.678072 | import pandas as pd
import os
def load_url_data(data_dir_path):
url_data = pd.read_csv(data_dir_path, sep=',')
url_data.columns = ['text', 'label']
class_zero = url_data[url_data['label'] == 0].reset_index()
class_one = url_data[url_data['label'] == 1].reset_index()
class_zero = class_zero.trun... | true | true |
1c26f23f1c4ad32ff06afeaa88bde06c8e2afffd | 1,894 | py | Python | clinica/pipelines/dwi_preprocessing_using_t1/dwi_preprocessing_using_t1_cli.py | MatthieuJoulot/clinica | c82f8ba6fd3d3c11076cb175ada13a4810c39d8b | [
"MIT"
] | 135 | 2019-05-17T14:16:40.000Z | 2022-03-19T03:08:05.000Z | clinica/pipelines/dwi_preprocessing_using_t1/dwi_preprocessing_using_t1_cli.py | MatthieuJoulot/clinica | c82f8ba6fd3d3c11076cb175ada13a4810c39d8b | [
"MIT"
] | 391 | 2019-06-03T09:32:17.000Z | 2022-03-31T15:10:26.000Z | clinica/pipelines/dwi_preprocessing_using_t1/dwi_preprocessing_using_t1_cli.py | MatthieuJoulot/clinica | c82f8ba6fd3d3c11076cb175ada13a4810c39d8b | [
"MIT"
] | 57 | 2019-05-20T08:38:01.000Z | 2022-02-11T12:14:32.000Z | from typing import Optional
import click
from clinica.pipelines import cli_param
pipeline_name = "dwi-preprocessing-using-t1"
@click.command(name=pipeline_name)
@cli_param.argument.bids_directory
@cli_param.argument.caps_directory
@cli_param.option_group.pipeline_specific_options
@cli_param.option.low_bval
@cli_pa... | 26.676056 | 92 | 0.726505 | from typing import Optional
import click
from clinica.pipelines import cli_param
pipeline_name = "dwi-preprocessing-using-t1"
@click.command(name=pipeline_name)
@cli_param.argument.bids_directory
@cli_param.argument.caps_directory
@cli_param.option_group.pipeline_specific_options
@cli_param.option.low_bval
@cli_pa... | true | true |
1c26f25b03bbbd98d2295371b215ed0f126fa6e1 | 6,398 | py | Python | IssueBook.py | S-ayanide/Library-Manager | 068a2643cddf926d0707237c6b35102773ed2307 | [
"Apache-2.0"
] | 13 | 2019-06-11T17:06:48.000Z | 2021-07-02T19:15:16.000Z | IssueBook.py | sojidavids/Library-Manager | 068a2643cddf926d0707237c6b35102773ed2307 | [
"Apache-2.0"
] | null | null | null | IssueBook.py | sojidavids/Library-Manager | 068a2643cddf926d0707237c6b35102773ed2307 | [
"Apache-2.0"
] | 12 | 2019-09-14T10:12:46.000Z | 2021-06-26T21:21:19.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 7 19:44:24 2019
J.A.R.V.I.S Says Hello
@author: Sayan
"""
from tkinter import *
from PIL import ImageTk,Image
from tkinter import messagebox
import pymysql
# Add your own database name and password here to reflect in the code
mypass = "1234"
mydatabase="rcpl_db"
con ... | 29.897196 | 134 | 0.590497 |
from tkinter import *
from PIL import ImageTk,Image
from tkinter import messagebox
import pymysql
mypass = "1234"
mydatabase="rcpl_db"
con = pymysql.connect(host="localhost",user="root",password=mypass,database=mydatabase)
cur = con.cursor()
issueTable = "issuedetail"
bookTable = "books"
stuTable = "studetail"... | true | true |
1c26f34e6445d40d57a94ddfc496f70d72ec0487 | 1,242 | py | Python | rpython/jit/tool/findadrinlog.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/jit/tool/findadrinlog.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/jit/tool/findadrinlog.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | import sys, re
from rpython.tool import logparser
# fflush(pypy_debug_file)
if len(sys.argv) != 3:
print "Usage: %s <log file> <address>" % sys.argv[0]
log = logparser.parse_log_file(sys.argv[1])
text = logparser.extract_category(log, catprefix='jit-backend')
address = int(sys.argv[2], 16)
for l in text:
m ... | 25.875 | 72 | 0.519324 | import sys, re
from rpython.tool import logparser
if len(sys.argv) != 3:
print "Usage: %s <log file> <address>" % sys.argv[0]
log = logparser.parse_log_file(sys.argv[1])
text = logparser.extract_category(log, catprefix='jit-backend')
address = int(sys.argv[2], 16)
for l in text:
m = re.match('(Loop|Bridge)... | false | true |
1c26f3c333728c382ba77a1b3d16b9a5c74ba70a | 1,407 | py | Python | 6.whileloops/challenge2_rouillonh.py | rouillonh/ChallengePython | 7e7d9b69f60394fd1f00a6a4aa32f97de95b1b92 | [
"MIT"
] | null | null | null | 6.whileloops/challenge2_rouillonh.py | rouillonh/ChallengePython | 7e7d9b69f60394fd1f00a6a4aa32f97de95b1b92 | [
"MIT"
] | null | null | null | 6.whileloops/challenge2_rouillonh.py | rouillonh/ChallengePython | 7e7d9b69f60394fd1f00a6a4aa32f97de95b1b92 | [
"MIT"
] | null | null | null | print("\tWelcome to the Even Odd Number Sorter App")
#Creamos la bandera para el bucle
band = True
while band:
#Le pedimos que ingrese la cadena de numeros separados por comas
nums= input("Enter in a string of numbers separated by a comma (,): ")
#Eliminamos los espacios en blanco
nums = nums.replace(" ... | 34.317073 | 102 | 0.588486 | print("\tWelcome to the Even Odd Number Sorter App")
band = True
while band:
nums= input("Enter in a string of numbers separated by a comma (,): ")
nums = nums.replace(" ","")
num_list = nums.split(",")
pares = []
impares = []
for i in num_list:
if int(i)%2 == 0:
... | true | true |
1c26f400de56570249417f233554bbc3fb587a75 | 2,784 | py | Python | mars/services/task/core.py | haijohn/mars | 672b3a33a70565f01b1a3f508908445491d85acf | [
"Apache-2.0"
] | 1 | 2021-06-10T02:43:01.000Z | 2021-06-10T02:43:01.000Z | mars/services/task/core.py | JeffroMF/mars | 2805241ac55b50c4f6319baa41113fbf8c723832 | [
"Apache-2.0"
] | null | null | null | mars/services/task/core.py | JeffroMF/mars | 2805241ac55b50c4f6319baa41113fbf8c723832 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.240506 | 76 | 0.627514 |
import random
from enum import Enum
from string import ascii_letters, digits
from typing import Any
from ...core import TileableGraph
from ...serialization.serializables import Serializable, StringField, \
ReferenceField, Int32Field, BoolField, AnyField, DictField
class TaskStatus(Enum):
pendin... | true | true |
1c26f4f53350c131bae4f3985b6131b591b878c7 | 4,650 | py | Python | SentimentAnalysis/segment.py | vyshnavi29/COURSE-GEN | aaea09f222904135236f7ccb79fe79a810fe71c7 | [
"MIT"
] | null | null | null | SentimentAnalysis/segment.py | vyshnavi29/COURSE-GEN | aaea09f222904135236f7ccb79fe79a810fe71c7 | [
"MIT"
] | null | null | null | SentimentAnalysis/segment.py | vyshnavi29/COURSE-GEN | aaea09f222904135236f7ccb79fe79a810fe71c7 | [
"MIT"
] | null | null | null | from nltk import FreqDist
import pickle
import sys
from utils import write_status
from collections import Counter
# Takes in a preprocessed CSV file and gives statistics
# Writes the frequency distribution of words and bigrams
# to pickle files.
def analyze_review(review):
result = {}
result['... | 42.272727 | 173 | 0.620645 | from nltk import FreqDist
import pickle
import sys
from utils import write_status
from collections import Counter
def analyze_review(review):
result = {}
result['MENTIONS'] = review.count('USER_MENTION')
result['URLS'] = review.count('URL')
result['POS_EMOS'] = review.count('EMO_POS'... | true | true |
1c26f6467a3caa502dca896a107ac99e866a1582 | 29,321 | py | Python | tests/base/test_endpoints_authorizations.py | rapydo/http-api | ef0a299173195145303069534d45d446ea4da93a | [
"MIT"
] | 8 | 2018-07-04T09:54:46.000Z | 2022-03-17T08:21:06.000Z | tests/base/test_endpoints_authorizations.py | rapydo/http-api | ef0a299173195145303069534d45d446ea4da93a | [
"MIT"
] | 19 | 2018-04-18T07:24:55.000Z | 2022-03-04T01:03:15.000Z | tests/base/test_endpoints_authorizations.py | rapydo/http-api | ef0a299173195145303069534d45d446ea4da93a | [
"MIT"
] | 7 | 2018-07-03T12:17:50.000Z | 2021-05-05T04:33:32.000Z | import re
from typing import Dict, List, Optional
import pytest
from restapi.config import ABS_RESTAPI_PATH
from restapi.connectors import Connector
from restapi.env import Env
from restapi.rest.loader import EndpointsLoader
from restapi.services.authentication import Role
from restapi.tests import SERVER_URI, BaseTe... | 37.98057 | 88 | 0.557825 | import re
from typing import Dict, List, Optional
import pytest
from restapi.config import ABS_RESTAPI_PATH
from restapi.connectors import Connector
from restapi.env import Env
from restapi.rest.loader import EndpointsLoader
from restapi.services.authentication import Role
from restapi.tests import SERVER_URI, BaseTe... | true | true |
1c26f71e96ff5938928bb2d356ebcd82db695030 | 927 | py | Python | refugio/refugio/urls.py | rodrigogomezromero/refugioanimal | 05613f766635f3025d12ce1e89d22c0c4f38ea82 | [
"MIT"
] | null | null | null | refugio/refugio/urls.py | rodrigogomezromero/refugioanimal | 05613f766635f3025d12ce1e89d22c0c4f38ea82 | [
"MIT"
] | null | null | null | refugio/refugio/urls.py | rodrigogomezromero/refugioanimal | 05613f766635f3025d12ce1e89d22c0c4f38ea82 | [
"MIT"
] | null | null | null | """refugio URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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-ba... | 37.08 | 79 | 0.701187 | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^mascota/', include('apps.mascota.urls',namespace="mascota")),
url(r'^adopcion/', include('apps.adopciones.urls',namespace="adopciones")),
]
| true | true |
1c26f77c11bf73e5475a3330193c212fb89cc1a7 | 469 | py | Python | network-import-loader/server.py | welchbj/python-metaprogramming-samples | ed9e613712f534566b247c3befdb615888786de8 | [
"MIT"
] | null | null | null | network-import-loader/server.py | welchbj/python-metaprogramming-samples | ed9e613712f534566b247c3befdb615888786de8 | [
"MIT"
] | null | null | null | network-import-loader/server.py | welchbj/python-metaprogramming-samples | ed9e613712f534566b247c3befdb615888786de8 | [
"MIT"
] | null | null | null | """Module-providing server which support imports from client.py."""
import socketserver
class ModuleServer(socketserver.BaseRequestHandler):
def handle(self):
print('Handling connection...')
with open('./hosted_module.py', 'rb') as f:
self.request.sendall(f.read())
if __name__ == '... | 26.055556 | 70 | 0.667377 |
import socketserver
class ModuleServer(socketserver.BaseRequestHandler):
def handle(self):
print('Handling connection...')
with open('./hosted_module.py', 'rb') as f:
self.request.sendall(f.read())
if __name__ == '__main__':
host, port = '127.0.0.1', 12345
with socketserver... | true | true |
1c26f7c7db2fd7044c074c3d194e242724f44890 | 736 | py | Python | pipeline/machine_learning/model/abstract_model_factory.py | lorenz0890/road_condition_classification | 86b6a06330149988a2167fdeeb69b6aa83c90f7a | [
"MIT"
] | null | null | null | pipeline/machine_learning/model/abstract_model_factory.py | lorenz0890/road_condition_classification | 86b6a06330149988a2167fdeeb69b6aa83c90f7a | [
"MIT"
] | null | null | null | pipeline/machine_learning/model/abstract_model_factory.py | lorenz0890/road_condition_classification | 86b6a06330149988a2167fdeeb69b6aa83c90f7a | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from utils.rctc_component import RCTCComponent
class ModelFactory(ABC, RCTCComponent):
def __init__(self):
super().__init__()
def create_model(self, model_type, X_train, y_train, X_test, y_test, model_params, search_params):
"""
:param X:
:p... | 21.647059 | 102 | 0.572011 | from abc import ABC, abstractmethod
from utils.rctc_component import RCTCComponent
class ModelFactory(ABC, RCTCComponent):
def __init__(self):
super().__init__()
def create_model(self, model_type, X_train, y_train, X_test, y_test, model_params, search_params):
def find_optimal_model(self, mode, ... | true | true |
1c26f81b510e4523dbec893c89061d8adef966eb | 2,582 | py | Python | scripts/create_ground_truth.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | null | null | null | scripts/create_ground_truth.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | null | null | null | scripts/create_ground_truth.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | null | null | null | import os
import logging
import dicom2nifti
import dicom2nifti.settings as settings
import dicom2nifti.image_reorientation as image_reorientation
def subdir_count(path):
count = 0
for f in os.listdir(path):
child = os.path.join(path, f)
if os.path.isdir(child):
count += 1
ret... | 35.369863 | 99 | 0.646398 | import os
import logging
import dicom2nifti
import dicom2nifti.settings as settings
import dicom2nifti.image_reorientation as image_reorientation
def subdir_count(path):
count = 0
for f in os.listdir(path):
child = os.path.join(path, f)
if os.path.isdir(child):
count += 1
ret... | true | true |
1c26f901cf59c0e696f6ed21e820cb46f30b1939 | 936 | py | Python | src/craftr/core/impl/DefaultPluginLoader.py | craftr-build/craftr-core | b7eee86c6ed6959cce274fd76b611555ca5d71e0 | [
"MIT"
] | 64 | 2015-10-16T01:04:24.000Z | 2021-08-05T06:35:24.000Z | src/craftr/core/impl/DefaultPluginLoader.py | craftr-build/craftr-core | b7eee86c6ed6959cce274fd76b611555ca5d71e0 | [
"MIT"
] | 192 | 2015-09-05T23:48:49.000Z | 2018-09-14T21:11:30.000Z | src/craftr/core/impl/DefaultPluginLoader.py | craftr-build/craftr-core | b7eee86c6ed6959cce274fd76b611555ca5d71e0 | [
"MIT"
] | 13 | 2015-10-16T01:04:31.000Z | 2020-10-29T09:37:44.000Z |
import dataclasses
import pkg_resources
from craftr.core.base import PluginLoader, Plugin
from craftr.core.exceptions import PluginNotFoundError
from craftr.core.settings import Settings
@dataclasses.dataclass
class DefaultPluginLoader(PluginLoader):
"""
Default implementation for loading plugins via the `craft... | 32.275862 | 112 | 0.760684 |
import dataclasses
import pkg_resources
from craftr.core.base import PluginLoader, Plugin
from craftr.core.exceptions import PluginNotFoundError
from craftr.core.settings import Settings
@dataclasses.dataclass
class DefaultPluginLoader(PluginLoader):
entrypoint_name: str = 'craftr.plugins'
@classmethod
def ... | true | true |
1c26f98a5eaaa4785c8aa19711c395dd621cada2 | 1,783 | py | Python | src/streamlink/plugins/sportschau.py | code-review-doctor/streamlink | 5dffc1520a18dca05562d1061dfae1f8c2368840 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/sportschau.py | code-review-doctor/streamlink | 5dffc1520a18dca05562d1061dfae1f8c2368840 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/sportschau.py | code-review-doctor/streamlink | 5dffc1520a18dca05562d1061dfae1f8c2368840 | [
"BSD-2-Clause"
] | null | null | null | """
$url sportschau.de
$type live
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPStream
from streamlink.utils.url import update_scheme
log = logging.getLogge... | 31.839286 | 124 | 0.628155 |
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPStream
from streamlink.utils.url import update_scheme
log = logging.getLogger(__name__)
@pluginmatcher(re.compil... | true | true |
1c26fab88c26a87d3ac0fcc62ef65ef0db5345e8 | 1,329 | py | Python | plugins/liquid_tags/speakerdeck.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 13 | 2020-01-27T09:02:25.000Z | 2022-01-20T07:45:26.000Z | plugins/liquid_tags/speakerdeck.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 29 | 2020-03-22T06:57:57.000Z | 2022-01-24T22:46:42.000Z | plugins/liquid_tags/speakerdeck.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 6 | 2020-07-10T00:13:30.000Z | 2022-01-26T08:22:33.000Z | """
Speakerdeck Tag
---------------
This implements a Liquid-style speakerdeck tag for Pelican.
Syntax
------
{% speakerdeck id %}
Example
-------
{% speakerdeck 82b209c0f181013106da6eb14261a8ef %}
Output
------
<script
async
class="speakerdeck-embed"
data-id="82b209c0f181013106da6eb14261a8ef"
data-r... | 23.315789 | 87 | 0.620767 | import re
from .mdx_liquid_tags import LiquidTags
SYNTAX = "{% speakerdeck id [ratio] %}"
REGEX = re.compile(r"([\S]+)(\s+(\d*\.?\d*))?")
@LiquidTags.register("speakerdeck")
def speakerdeck(preprocessor, tag, markup):
ratio = 1.33333333333333
id = None
match = REGEX.search(markup)
if match:
... | true | true |
1c26fae29cbaf5f856b8cb123a76e6d3dac23d77 | 359 | py | Python | web/api/lab_objects/serializers.py | cclrobotics/ARTBot | a0bffabebbc09361bf7748741fe3d30c78af8fbd | [
"MIT"
] | 5 | 2020-12-04T19:28:42.000Z | 2021-12-07T16:14:28.000Z | web/api/lab_objects/serializers.py | cclrobotics/ARTBot | a0bffabebbc09361bf7748741fe3d30c78af8fbd | [
"MIT"
] | 50 | 2019-10-08T19:47:24.000Z | 2021-07-26T05:43:37.000Z | web/api/lab_objects/serializers.py | cclrobotics/ARTBot | a0bffabebbc09361bf7748741fe3d30c78af8fbd | [
"MIT"
] | 4 | 2019-10-23T04:14:49.000Z | 2021-08-01T01:22:37.000Z | from marshmallow import (fields, Schema, post_load, EXCLUDE)
from numbers import Number
class LabObjectPropertySchema(Schema):
name = fields.Str(required=True)
value = fields.Field(required=True)
units = fields.Str(required=False)
def __init__(self, many=False):
Schema.__init__(self, many=man... | 25.642857 | 60 | 0.710306 | from marshmallow import (fields, Schema, post_load, EXCLUDE)
from numbers import Number
class LabObjectPropertySchema(Schema):
name = fields.Str(required=True)
value = fields.Field(required=True)
units = fields.Str(required=False)
def __init__(self, many=False):
Schema.__init__(self, many=man... | true | true |
1c26fbff0952260ac749b48fbc8edb943dbe9cd1 | 1,520 | py | Python | clients/python/templater.py | kcollinssibley/sysadmin | 81b6c424f7d9d5c25724cd1f544902ff3ff62cc2 | [
"Apache-2.0"
] | 14 | 2017-05-31T19:38:25.000Z | 2022-01-19T20:56:32.000Z | clients/python/templater.py | kcollinssibley/sysadmin | 81b6c424f7d9d5c25724cd1f544902ff3ff62cc2 | [
"Apache-2.0"
] | 26 | 2017-06-07T14:05:07.000Z | 2020-01-29T20:06:34.000Z | clients/python/templater.py | kcollinssibley/sysadmin | 81b6c424f7d9d5c25724cd1f544902ff3ff62cc2 | [
"Apache-2.0"
] | 9 | 2017-05-31T21:09:59.000Z | 2021-05-14T15:11:18.000Z | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os
from sysadmin import ConfigTemplateRenderer
from sysadmin import LazySysAdmin
from sysadmin import SysAdminClient
def main():
parser = argparse.ArgumentParser(description="Templater for config files")
parser.add_argument('... | 33.777778 | 78 | 0.65 |
from __future__ import print_function
import argparse
import os
from sysadmin import ConfigTemplateRenderer
from sysadmin import LazySysAdmin
from sysadmin import SysAdminClient
def main():
parser = argparse.ArgumentParser(description="Templater for config files")
parser.add_argument('--template-args', typ... | true | true |
1c26fcd454c0836130e09e7f94f1c654d08514fb | 1,298 | py | Python | dtreeplacement_web/views.py | Renophaston/dtreeplacement-web | 4b69fbe8af9f45ce4c8cebc98a4bffdc46a6c868 | [
"MIT"
] | null | null | null | dtreeplacement_web/views.py | Renophaston/dtreeplacement-web | 4b69fbe8af9f45ce4c8cebc98a4bffdc46a6c868 | [
"MIT"
] | null | null | null | dtreeplacement_web/views.py | Renophaston/dtreeplacement-web | 4b69fbe8af9f45ce4c8cebc98a4bffdc46a6c868 | [
"MIT"
] | null | null | null | """Views and routes for the UI.
URL scheme I'm thinking about:
/ (index)
/items (all items somehow)
/items/<int:item_id> (one item)
User stuff will come later, and will include stuff like create_tables.
"""
from app import app, db
from flask import render_template
@app.route('/')
def index():
return render_tem... | 23.178571 | 70 | 0.644068 |
from app import app, db
from flask import render_template
@app.route('/')
def index():
return render_template('index.j2')
@app.route('/createtables')
def create_tables():
db.create_all()
return render_template(
'index.j2',
title='Index',
message='ATTEMPTED to create tables, anyw... | true | true |
1c26feac9c5b4cc0926b41c0c84b9dcbb06a580b | 1,783 | py | Python | data-science-not/assignments/ass3/listener.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 4 | 2019-07-03T00:57:01.000Z | 2020-12-11T23:06:11.000Z | data-science-not/assignments/ass3/listener.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 1 | 2019-10-19T17:42:42.000Z | 2019-10-19T17:42:42.000Z | data-science-not/assignments/ass3/listener.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 1 | 2019-11-05T04:14:08.000Z | 2019-11-05T04:14:08.000Z | #!/usr/bin/env python
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler, Stream
from time import sleep
class TweetToFileListener(StreamListener):
def set_output_file(self, file_name):
open(file_name, 'w').close()
self.output_file = file_name
def on_data(self, data)... | 29.716667 | 86 | 0.632081 |
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler, Stream
from time import sleep
class TweetToFileListener(StreamListener):
def set_output_file(self, file_name):
open(file_name, 'w').close()
self.output_file = file_name
def on_data(self, data):
with open(s... | true | true |
1c2702113b9776f7c18c62ab8c26fee1cfe979e7 | 12,977 | py | Python | elasticsearch/client/cluster.py | shdkpr2008/elasticsearch-py | 625c834d5b59f943c48c16565fdbc6e77ed8f3c1 | [
"Apache-2.0"
] | null | null | null | elasticsearch/client/cluster.py | shdkpr2008/elasticsearch-py | 625c834d5b59f943c48c16565fdbc6e77ed8f3c1 | [
"Apache-2.0"
] | null | null | null | elasticsearch/client/cluster.py | shdkpr2008/elasticsearch-py | 625c834d5b59f943c48c16565fdbc6e77ed8f3c1 | [
"Apache-2.0"
] | null | null | null | from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class ClusterClient(NamespacedClient):
@query_params(
"expand_wildcards",
"level",
"local",
"master_timeout",
"timeout",
"wait_for_active_shards",
"wait_for_events",
"wait_fo... | 42.970199 | 108 | 0.643523 | from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class ClusterClient(NamespacedClient):
@query_params(
"expand_wildcards",
"level",
"local",
"master_timeout",
"timeout",
"wait_for_active_shards",
"wait_for_events",
"wait_fo... | true | true |
1c27021880d5e056582d95dbeaadee368504af78 | 390 | py | Python | jupyterlab2pymolpysnips/UnitCellDisplay/sc122.py | MooersLab/pymolpysnips | 50a89c85adf8006d85c1d6cd3f8aad7e440a0b92 | [
"MIT"
] | null | null | null | jupyterlab2pymolpysnips/UnitCellDisplay/sc122.py | MooersLab/pymolpysnips | 50a89c85adf8006d85c1d6cd3f8aad7e440a0b92 | [
"MIT"
] | null | null | null | jupyterlab2pymolpysnips/UnitCellDisplay/sc122.py | MooersLab/pymolpysnips | 50a89c85adf8006d85c1d6cd3f8aad7e440a0b92 | [
"MIT"
] | null | null | null | """
cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py')
cmd.do('supercell 1, 1, 1, , ${2:orange}, ${3:supercell1}, 1;')
"""
cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py')
cmd.do('supercell 1, 1, 1, , orange, supercell1, 1;')
# Description: Display all symmetry mates in a 1 x 2 x 2 array of unit cells. Uses... | 35.454545 | 128 | 0.689744 | cmd.do('run $HOME/Scripts/PyMOLscripts/supercell.py')
cmd.do('supercell 1, 1, 1, , orange, supercell1, 1;')
| true | true |
1c2703b98e611fed4d466ba6a97a9fd18aaa09ca | 3,579 | py | Python | chapter_13/downloadflat.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_13/downloadflat.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_13/downloadflat.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | "Transferring Directories with ftplib"
'Downloading Site Directories'
#!/usr/bin/env python
"""
###############################################################################
use FTP to copy (download) all files from a single directory at a remote
site to a directory on the local machine; run me periodically to mirror... | 46.480519 | 83 | 0.586477 |
import os, sys, ftplib
from getpass import getpass
from mimetypes import guess_type
nonpassive = False
remotesite = 'home.rmi.net'
remotedir = '.'
remoteuser = 'lutz'
remotepass = getpass('Password for %s on %s: ' % (remoteuser, remotesite))
localdi... | true | true |
1c2703caae889d85b1070bc350fc59cc834e5f50 | 2,184 | py | Python | agora/SimpleApiParser.py | beg0/arago | a24875c94be62f88667ea2af8f7724b3405e49e9 | [
"MIT"
] | null | null | null | agora/SimpleApiParser.py | beg0/arago | a24875c94be62f88667ea2af8f7724b3405e49e9 | [
"MIT"
] | null | null | null | agora/SimpleApiParser.py | beg0/arago | a24875c94be62f88667ea2af8f7724b3405e49e9 | [
"MIT"
] | null | null | null | # vim: set syntax=python:
# vim: set ts=4 sts=4 sw=4 et:
# AGORA Another Generator Of Rest Api
# Copyright (c) 2018, 2019 - beg0
#
""" Light parser to generate resource tree programatically. """
from agora.InternalNode import InternalNode
class SimpleApiParser(object):
"""
A Simple (e.g. light) API parser.
... | 34.125 | 93 | 0.538004 |
from agora.InternalNode import InternalNode
class SimpleApiParser(object):
def __init__(self, resources_list):
assert isinstance(resources_list, list), \
"must be a list of resource, got %s" % type(resources_list).__name__
for res in resources_list:
assert isinstanc... | true | true |
1c27050fda778c225b8d18ecee23a73e9e6061ca | 18,193 | py | Python | katpoint/conversion.py | ska-telescope/katpoint | 0e94e17db179065835c701ddaba079854eb1e7e5 | [
"BSD-3-Clause"
] | null | null | null | katpoint/conversion.py | ska-telescope/katpoint | 0e94e17db179065835c701ddaba079854eb1e7e5 | [
"BSD-3-Clause"
] | null | null | null | katpoint/conversion.py | ska-telescope/katpoint | 0e94e17db179065835c701ddaba079854eb1e7e5 | [
"BSD-3-Clause"
] | null | null | null | ################################################################################
# Copyright (c) 2009-2020, National Research Foundation (SARAO)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
# ... | 38.060669 | 100 | 0.616721 | true | true | |
1c27057f3b7b5ce8ecd9ec43fc42f56948e1368f | 352 | py | Python | python/cs4.py | Surya-06/My-Solutions | 58f7c7f1a0a3a28f25eff22d03a09cb2fbcf7806 | [
"MIT"
] | null | null | null | python/cs4.py | Surya-06/My-Solutions | 58f7c7f1a0a3a28f25eff22d03a09cb2fbcf7806 | [
"MIT"
] | null | null | null | python/cs4.py | Surya-06/My-Solutions | 58f7c7f1a0a3a28f25eff22d03a09cb2fbcf7806 | [
"MIT"
] | null | null | null | size=int(raw_input())
a=[]
for i in range(size):
t,t1 = raw_input().split()
if i<size/2:
temp=[]
temp.append(int(t))
temp.append("-")
a.append(temp)
else:
temp=[]
temp.append(int(t))
temp.append(t1)
a.append(temp)
a.sort(key=lambda tup:tup[0... | 16 | 30 | 0.5 | size=int(raw_input())
a=[]
for i in range(size):
t,t1 = raw_input().split()
if i<size/2:
temp=[]
temp.append(int(t))
temp.append("-")
a.append(temp)
else:
temp=[]
temp.append(int(t))
temp.append(t1)
a.append(temp)
a.sort(key=lambda tup:tup[0... | false | true |
1c2705996ed48f9acfe2a6015088022f43d16c4c | 13,077 | py | Python | a2c/a2c.py | nathangrinsztajn/RL_for_dynamic_scheduling | 04e7d7dda192a168aa22d226a348fb2114f4fba4 | [
"BSD-3-Clause"
] | 10 | 2021-05-10T02:45:11.000Z | 2022-03-22T08:17:47.000Z | a2c/a2c.py | nathangrinsztajn/RL_for_dynamic_scheduling | 04e7d7dda192a168aa22d226a348fb2114f4fba4 | [
"BSD-3-Clause"
] | null | null | null | a2c/a2c.py | nathangrinsztajn/RL_for_dynamic_scheduling | 04e7d7dda192a168aa22d226a348fb2114f4fba4 | [
"BSD-3-Clause"
] | 3 | 2020-12-07T11:50:09.000Z | 2021-11-23T06:13:14.000Z | import itertools
import time
import numpy as np
import os
import pandas as pd
import random
from copy import deepcopy
import torch
import torch.nn.functional as F
from torch import optim
from torch.optim.lr_scheduler import CyclicLR, LambdaLR
# from torch_geometric.data import Batch
from joblib import Parallel, delaye... | 42.183871 | 167 | 0.577808 | import itertools
import time
import numpy as np
import os
import pandas as pd
import random
from copy import deepcopy
import torch
import torch.nn.functional as F
from torch import optim
from torch.optim.lr_scheduler import CyclicLR, LambdaLR
from joblib import Parallel, delayed
import matplotlib.pyplot as plt
import... | true | true |
1c27071b2c8b75a462d679f66d02df4a579fa0c8 | 20,888 | py | Python | decora_wifi/models/organization.py | 7ooL/api_decora | 6a92a2d20c47e5b10702778255a863643cca3665 | [
"MIT"
] | null | null | null | decora_wifi/models/organization.py | 7ooL/api_decora | 6a92a2d20c47e5b10702778255a863643cca3665 | [
"MIT"
] | null | null | null | decora_wifi/models/organization.py | 7ooL/api_decora | 6a92a2d20c47e5b10702778255a863643cca3665 | [
"MIT"
] | null | null | null | # Leviton Cloud Services API model Organization.
# Auto-generated by api_scraper.py.
#
# Copyright 2017 Tim Lyakhovetskiy <tlyakhov@gmail.com>
#
# This code is released under the terms of the MIT license. See the LICENSE
# file for more details.
from ..base_model import BaseModel
class Organization(BaseModel):
de... | 35.890034 | 91 | 0.606281 |
from ..base_model import BaseModel
class Organization(BaseModel):
def __init__(self, session, model_id=None):
super(Organization, self).__init__(session, model_id)
def add_person(self, attribs=None):
if attribs is None:
attribs = {}
api = "/Organizations/{0}/addPers... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.