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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7717fc58591c88d116b525e38336c500a21db68 | 36 | py | Python | examples/taiwan_travel/__init__.py | john-hu/oclGA | 9edf311341f2b99c14080427425be7705f2c8dd8 | [
"MIT"
] | 1 | 2019-05-25T16:58:27.000Z | 2019-05-25T16:58:27.000Z | examples/taiwan_travel/__init__.py | john-hu/oclGA | 9edf311341f2b99c14080427425be7705f2c8dd8 | [
"MIT"
] | null | null | null | examples/taiwan_travel/__init__.py | john-hu/oclGA | 9edf311341f2b99c14080427425be7705f2c8dd8 | [
"MIT"
] | null | null | null | from .taiwan_travel import run_task
| 18 | 35 | 0.861111 | from .taiwan_travel import run_task
| true | true |
f7717fcd006248f6b927d0df74d3f6ab66328843 | 3,312 | py | Python | pyuptimerobot/decorator.py | chemelli74/pyuptimerobot | 50da42dbb26347b4b5254515bebbee95878c8e9b | [
"MIT"
] | 2 | 2021-11-14T18:24:08.000Z | 2022-01-31T07:44:52.000Z | pyuptimerobot/decorator.py | chemelli74/pyuptimerobot | 50da42dbb26347b4b5254515bebbee95878c8e9b | [
"MIT"
] | 24 | 2021-08-04T20:08:16.000Z | 2022-03-29T06:15:51.000Z | pyuptimerobot/decorator.py | chemelli74/pyuptimerobot | 50da42dbb26347b4b5254515bebbee95878c8e9b | [
"MIT"
] | 2 | 2021-09-01T21:11:40.000Z | 2022-02-02T00:32:14.000Z | """Decorator for Uptime Robot"""
from __future__ import annotations
import asyncio
from typing import TYPE_CHECKING
import aiohttp
from pyuptimerobot import exceptions
from .const import API_BASE_URL, API_HEADERS, LOGGER
from .models import APIStatus, UptimeRobotApiResponse
if TYPE_CHECKING:
from .uptimerobot ... | 34.863158 | 89 | 0.557367 | from __future__ import annotations
import asyncio
from typing import TYPE_CHECKING
import aiohttp
from pyuptimerobot import exceptions
from .const import API_BASE_URL, API_HEADERS, LOGGER
from .models import APIStatus, UptimeRobotApiResponse
if TYPE_CHECKING:
from .uptimerobot import UptimeRobot
def api_requ... | true | true |
f7718006fcc5a1bdd4daa6f8386696df728d07ba | 2,428 | py | Python | telemanom/helpers.py | CalenBlake/Anom_Base | 687b8a397b794962c50a6bdce924abd591bbe62c | [
"Apache-2.0"
] | 790 | 2018-06-02T02:30:30.000Z | 2022-03-31T04:22:52.000Z | telemanom/helpers.py | CalenBlake/Anom_Base | 687b8a397b794962c50a6bdce924abd591bbe62c | [
"Apache-2.0"
] | 60 | 2018-07-09T16:19:34.000Z | 2022-03-09T08:43:09.000Z | telemanom/helpers.py | CalenBlake/Anom_Base | 687b8a397b794962c50a6bdce924abd591bbe62c | [
"Apache-2.0"
] | 221 | 2018-06-02T13:34:39.000Z | 2022-03-11T23:03:20.000Z | import logging
import yaml
import json
import sys
import os
logger = logging.getLogger('telemanom')
sys.path.append('../telemanom')
class Config:
"""Loads parameters from config.yaml into global object
"""
def __init__(self, path_to_config):
self.path_to_config = path_to_config
if os.... | 29.975309 | 130 | 0.63056 | import logging
import yaml
import json
import sys
import os
logger = logging.getLogger('telemanom')
sys.path.append('../telemanom')
class Config:
def __init__(self, path_to_config):
self.path_to_config = path_to_config
if os.path.isfile(path_to_config):
pass
else:
... | true | true |
f77181f84e11b962183b652d52ba65d9453694bb | 1,257 | py | Python | octoprint_marlin_flasher/validation/base_validator.py | AvanOsch/OctoPrint-Marlin-Flasher | acc294d3eeb081f6967136389740c60a75c21f28 | [
"MIT"
] | 41 | 2019-04-02T23:05:19.000Z | 2022-03-31T09:39:08.000Z | octoprint_marlin_flasher/validation/base_validator.py | AvanOsch/OctoPrint-Marlin-Flasher | acc294d3eeb081f6967136389740c60a75c21f28 | [
"MIT"
] | 82 | 2019-04-02T14:50:42.000Z | 2022-03-26T05:33:55.000Z | octoprint_marlin_flasher/validation/base_validator.py | AvanOsch/OctoPrint-Marlin-Flasher | acc294d3eeb081f6967136389740c60a75c21f28 | [
"MIT"
] | 9 | 2019-10-16T08:16:11.000Z | 2022-01-19T10:59:44.000Z | from .validator_error import ValidatorError
class BaseValidator:
def __init__(self, settings):
self._settings = settings
def validate_upload(self):
raise ValidatorError("Unsupported function call.")
def validate_download(self):
raise ValidatorError("Unsupported function call.")
def validate_firmware(sel... | 26.744681 | 52 | 0.793158 | from .validator_error import ValidatorError
class BaseValidator:
def __init__(self, settings):
self._settings = settings
def validate_upload(self):
raise ValidatorError("Unsupported function call.")
def validate_download(self):
raise ValidatorError("Unsupported function call.")
def validate_firmware(sel... | true | true |
f7718250c664f0444b53b72473418200c39872c5 | 735 | py | Python | code/tests/test_nn.py | pavelsof/mstnn | 2569f935597ba888cc9449e6affb99fe9879663c | [
"MIT"
] | 3 | 2018-03-14T14:05:36.000Z | 2019-09-26T14:17:04.000Z | code/tests/test_nn.py | pavelsof/mstnn | 2569f935597ba888cc9449e6affb99fe9879663c | [
"MIT"
] | null | null | null | code/tests/test_nn.py | pavelsof/mstnn | 2569f935597ba888cc9449e6affb99fe9879663c | [
"MIT"
] | null | null | null | import os.path
import tempfile
from unittest import TestCase
from code.nn import NeuralNetwork
class NeuralNetworkTestCase(TestCase):
def setUp(self):
self.net = NeuralNetwork(vocab_sizes={
'forms': 42, 'lemmas': 42, 'morph': 104, 'pos_tags': 18})
def test_model_files_error(self):
with tempfile.Temp... | 21.617647 | 60 | 0.719728 | import os.path
import tempfile
from unittest import TestCase
from code.nn import NeuralNetwork
class NeuralNetworkTestCase(TestCase):
def setUp(self):
self.net = NeuralNetwork(vocab_sizes={
'forms': 42, 'lemmas': 42, 'morph': 104, 'pos_tags': 18})
def test_model_files_error(self):
with tempfile.Temp... | true | true |
f77184305b0f34b3d59241c56f1e83c36ff88ad0 | 4,119 | py | Python | bhatta_dist.py | EricPWilliamson/bhattacharyya-distance | d67498d58bed342151c9d820a520254a503abdc8 | [
"MIT"
] | 12 | 2018-04-14T14:27:29.000Z | 2022-03-08T02:27:07.000Z | bhatta_dist.py | EricPWilliamson/bhattacharyya-distance | d67498d58bed342151c9d820a520254a503abdc8 | [
"MIT"
] | 1 | 2021-02-02T05:25:06.000Z | 2021-02-02T05:25:06.000Z | bhatta_dist.py | EricPWilliamson/bhattacharyya-distance | d67498d58bed342151c9d820a520254a503abdc8 | [
"MIT"
] | 4 | 2019-02-02T07:51:27.000Z | 2020-11-20T07:55:39.000Z | """
The function bhatta_dist() calculates the Bhattacharyya distance between two classes on a single feature.
The distance is positively correlated to the class separation of this feature. Four different methods are
provided for calculating the Bhattacharyya coefficient.
Created on 4/14/2018
Author: Eric... | 39.228571 | 129 | 0.599175 | import numpy as np
from math import sqrt
from scipy.stats import gaussian_kde
def bhatta_dist(X1, X2, method='continuous'):
def get_density(x, cov_factor=0.1):
density = gaussian_kde(x)
density.covariance_factor = lambda:cov_factor
density._compute_covariance()
... | true | true |
f771843c8bf978868f6ecaa94ac9cb8abe22989d | 3,568 | py | Python | src/inference/UNetInferenceAgent.py | zenetio/AI-4-Clinical-Workflow | 7128f2eeafb5e5fc5a70e7c3770847ca1c924dea | [
"MIT"
] | 14 | 2020-09-14T07:22:43.000Z | 2021-11-16T12:34:54.000Z | src/inference/UNetInferenceAgent.py | zenetio/AI-4-Clinical-Workflow | 7128f2eeafb5e5fc5a70e7c3770847ca1c924dea | [
"MIT"
] | 1 | 2021-11-12T18:53:47.000Z | 2021-11-12T20:52:22.000Z | src/inference/UNetInferenceAgent.py | zenetio/AI-4-Clinical-Workflow | 7128f2eeafb5e5fc5a70e7c3770847ca1c924dea | [
"MIT"
] | 2 | 2020-09-29T08:05:45.000Z | 2021-08-21T10:01:02.000Z | """
Contains class that runs inferencing
"""
import torch
import numpy as np
from networks.RecursiveUNet import UNet
from utils.utils import med_reshape
class UNetInferenceAgent:
"""
Stores model and parameters and some methods to handle inferencing
"""
def __init__(self, parameter_file_path='', mode... | 37.957447 | 106 | 0.628083 | import torch
import numpy as np
from networks.RecursiveUNet import UNet
from utils.utils import med_reshape
class UNetInferenceAgent:
def __init__(self, parameter_file_path='', model=None, device="cpu", patch_size=64):
self.model = model
self.patch_size = patch_size
self.device = device
... | true | true |
f7718577f92b0533a1a9d47a5a97ba3f96a1f20c | 1,021 | py | Python | passwords_test.py | yahyasaadi/passwordLocker | ba0a4470b697e6eeac49311bf257c5fa7706025b | [
"MIT"
] | null | null | null | passwords_test.py | yahyasaadi/passwordLocker | ba0a4470b697e6eeac49311bf257c5fa7706025b | [
"MIT"
] | null | null | null | passwords_test.py | yahyasaadi/passwordLocker | ba0a4470b697e6eeac49311bf257c5fa7706025b | [
"MIT"
] | null | null | null | import unittest
from passwords import Password
class TestAccount(unittest.TestCase):
def setUp(self):
"""
Set up method to run before each test cases
"""
self.new_password = Password("Instagram", "yahyanoor", "1234")
# The first test
def test_init(self):
... | 26.868421 | 99 | 0.621939 | import unittest
from passwords import Password
class TestAccount(unittest.TestCase):
def setUp(self):
self.new_password = Password("Instagram", "yahyanoor", "1234")
def test_init(self):
self.assertEqual(self.new_password.siteName, "Instagram")
self.assertEqual(self.new_... | true | true |
f771861957b4594ce2dcc2dff1dd36581965ae3d | 13,469 | py | Python | src/sage/combinat/words/alphabet.py | bopopescu/sagesmc | e8d1d31f6f598dba2d763baa2d2e804338f9e89e | [
"BSL-1.0"
] | 5 | 2015-01-04T07:15:06.000Z | 2022-03-04T15:15:18.000Z | src/sage/combinat/words/alphabet.py | bopopescu/sagesmc | e8d1d31f6f598dba2d763baa2d2e804338f9e89e | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/words/alphabet.py | bopopescu/sagesmc | e8d1d31f6f598dba2d763baa2d2e804338f9e89e | [
"BSL-1.0"
] | 10 | 2016-09-28T13:12:40.000Z | 2022-02-12T09:28:34.000Z | # coding=utf-8
r"""
Alphabet
AUTHORS:
- Franco Saliola (2008-12-17) : merged into sage
- Vincent Delecroix and Stepan Starosta (2012): remove classes for alphabet and
use other Sage classes otherwise (TotallyOrderFiniteSet, FiniteEnumeratedSet,
...). More shortcut to standard alphabets.
EXAMPLES::
sage: bui... | 37.104683 | 138 | 0.62113 | from sage.categories.sets_cat import Sets
from sage.sets.totally_ordered_finite_set import TotallyOrderedFiniteSet
from sage.sets.family import Family
from sage.rings.integer import Integer
from sage.rings.infinity import Infinity
from sage.sets.non_negative_integers import NonNegativeIntegers
from sage.sets.positiv... | true | true |
f771861e79823b3382aaaa086597aab1d82607dd | 870 | py | Python | docs/web/howto/listings/client/responseBody.py | hawkowl/twisted | c413aac3888dea2202c0dc26f978d7f88b4b837a | [
"Unlicense",
"MIT"
] | 1 | 2019-02-08T18:37:42.000Z | 2019-02-08T18:37:42.000Z | docs/web/howto/listings/client/responseBody.py | hawkowl/twisted | c413aac3888dea2202c0dc26f978d7f88b4b837a | [
"Unlicense",
"MIT"
] | 5 | 2020-06-05T18:16:39.000Z | 2022-01-13T00:45:49.000Z | docs/web/howto/listings/client/responseBody.py | hawkowl/twisted | c413aac3888dea2202c0dc26f978d7f88b4b837a | [
"Unlicense",
"MIT"
] | 1 | 2019-01-25T18:08:19.000Z | 2019-01-25T18:08:19.000Z | from __future__ import print_function
from sys import argv
from pprint import pformat
from twisted.internet.task import react
from twisted.web.client import Agent, readBody
from twisted.web.http_headers import Headers
def cbRequest(response):
print('Response version:', response.version)
print('Response code... | 24.857143 | 64 | 0.694253 | from __future__ import print_function
from sys import argv
from pprint import pformat
from twisted.internet.task import react
from twisted.web.client import Agent, readBody
from twisted.web.http_headers import Headers
def cbRequest(response):
print('Response version:', response.version)
print('Response code... | true | true |
f77187de72ce59ea9eedd1e1d78f40cb2a9ccee7 | 1,859 | py | Python | tests/unit/core/test_framework.py | mhaas/cf-python-logging-support | 86b7e8ef35b935401bdec7da275fe4e09302988c | [
"Apache-2.0"
] | 16 | 2017-11-30T06:17:07.000Z | 2021-09-13T13:41:17.000Z | tests/unit/core/test_framework.py | mhaas/cf-python-logging-support | 86b7e8ef35b935401bdec7da275fe4e09302988c | [
"Apache-2.0"
] | 32 | 2017-12-01T14:48:17.000Z | 2022-02-19T04:49:55.000Z | tests/unit/core/test_framework.py | mhaas/cf-python-logging-support | 86b7e8ef35b935401bdec7da275fe4e09302988c | [
"Apache-2.0"
] | 7 | 2018-03-08T15:52:55.000Z | 2022-02-27T18:52:57.000Z | """ Tests `core.framework` """
import pytest
from sap.cf_logging.core.context import Context
from sap.cf_logging.core.request_reader import RequestReader
from sap.cf_logging.core.response_reader import ResponseReader
from sap.cf_logging.core.framework import Framework
# pylint: disable=abstract-method
CONTEXT = Conte... | 37.938776 | 92 | 0.742873 | import pytest
from sap.cf_logging.core.context import Context
from sap.cf_logging.core.request_reader import RequestReader
from sap.cf_logging.core.response_reader import ResponseReader
from sap.cf_logging.core.framework import Framework
CONTEXT = Context()
REQUEST_READER = RequestReader()
RESPONSE_READER = ResponseR... | true | true |
f77187f72f45368cb1f1a883c5a7d08f47a51a70 | 390 | py | Python | BOJ/dp_boj/coins1.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/dp_boj/coins1.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/dp_boj/coins1.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # BOJ 2293
import sys
si = sys.stdin.readline
n, k = map(int, si().split())
coins = []
for _ in range(n):
coins.append(int(si()))
coins.sort()
def solve(n, k):
dp = [0] * (k + 1)
dp[0] = 1
for i in range(n):
for j in range(coins[i], k + 1):
if j - coins[i] >= 0:
... | 16.25 | 48 | 0.479487 | import sys
si = sys.stdin.readline
n, k = map(int, si().split())
coins = []
for _ in range(n):
coins.append(int(si()))
coins.sort()
def solve(n, k):
dp = [0] * (k + 1)
dp[0] = 1
for i in range(n):
for j in range(coins[i], k + 1):
if j - coins[i] >= 0:
dp[j] = dp[... | true | true |
f771881a07efb0a111d0dc723b0a4db579fcce04 | 1,027 | py | Python | mmdet/models/__init__.py | TJUsym/TJU_Advanced_CV_Homework | 2d85943390e9ba53b80988e0ab8d50aef0cd17da | [
"Apache-2.0"
] | 643 | 2020-01-28T11:29:49.000Z | 2022-03-31T08:28:32.000Z | mmdet/models/__init__.py | TJUsym/TJU_Advanced_CV_Homework | 2d85943390e9ba53b80988e0ab8d50aef0cd17da | [
"Apache-2.0"
] | 148 | 2021-03-18T09:44:02.000Z | 2022-03-31T06:01:39.000Z | mmdet/models/__init__.py | TJUsym/TJU_Advanced_CV_Homework | 2d85943390e9ba53b80988e0ab8d50aef0cd17da | [
"Apache-2.0"
] | 197 | 2020-01-29T09:58:27.000Z | 2022-03-25T12:08:56.000Z | from .backbones import * # noqa: F401,F403
from .necks import * # noqa: F401,F403
from .roi_extractors import * # noqa: F401,F403
from .rroi_extractors import * # noqa: F401, F403
from .anchor_heads import * # noqa: F401,F403
from .shared_heads import * # noqa: F401,F403
from .bbox_heads import * # noqa: F401,F40... | 44.652174 | 78 | 0.686465 | from .backbones import * from .necks import * from .roi_extractors import * from .rroi_extractors import * from .anchor_heads import * from .shared_heads import * from .bbox_heads import * from .rbbox_heads import * from .mask_heads import * from .losses import * from .detectors import * from .registry import ... | true | true |
f77188b38a014b561a46fb2e8327642e31f23697 | 9,830 | py | Python | combine.py | WouterKoch/Naturalis_data_preparation | 05d60d2913838297d30959ccf1388028ac8553bc | [
"MIT"
] | null | null | null | combine.py | WouterKoch/Naturalis_data_preparation | 05d60d2913838297d30959ccf1388028ac8553bc | [
"MIT"
] | null | null | null | combine.py | WouterKoch/Naturalis_data_preparation | 05d60d2913838297d30959ccf1388028ac8553bc | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from tqdm import tqdm
import os
import sys
import hashlib
def generateId(image_url, prefix, exisiting_ids):
id = f"{prefix}:{hashlib.md5(image_url.encode()).hexdigest()}"
# while id in exisiting_ids:
# print(f"id {id} exists!")
# image_url = image_url + "1... | 71.231884 | 245 | 0.717599 | import numpy as np
import pandas as pd
from tqdm import tqdm
import os
import sys
import hashlib
def generateId(image_url, prefix, exisiting_ids):
id = f"{prefix}:{hashlib.md5(image_url.encode()).hexdigest()}"
return id
def combine(taxonfiles, imagefiles, outputfolder, previousImageList):... | true | true |
f77188f9f7483a56b1d4078315e74446a6d27b4a | 6,582 | py | Python | ingestion/functions/aws_access/ScheduleRuleTests.py | open-covid-data/healthmap-gdo-temp | 5af5c9e2f7dcefa9039dc6b3a2e2c5094566fc2e | [
"MIT"
] | 5 | 2020-04-16T13:54:24.000Z | 2020-07-06T13:42:10.000Z | ingestion/functions/aws_access/ScheduleRuleTests.py | open-covid-data/healthmap-gdo-temp | 5af5c9e2f7dcefa9039dc6b3a2e2c5094566fc2e | [
"MIT"
] | 487 | 2020-04-16T00:56:09.000Z | 2020-07-27T09:09:29.000Z | ingestion/functions/aws_access/ScheduleRuleTests.py | open-covid-data/healthmap-gdo-temp | 5af5c9e2f7dcefa9039dc6b3a2e2c5094566fc2e | [
"MIT"
] | null | null | null | import unittest
from datetime import datetime, timedelta
from .EventBridgeClient import EventBridgeClient, date_of_requested_weekday_in_month
class ScheduleRuleTests(unittest.TestCase):
real_ingestion_rule = {
'Arn': 'arn:aws:events:eu-central-1:612888738066:rule/taiwan-taiwan-ingestor-prod',
'Des... | 52.656 | 154 | 0.72364 | import unittest
from datetime import datetime, timedelta
from .EventBridgeClient import EventBridgeClient, date_of_requested_weekday_in_month
class ScheduleRuleTests(unittest.TestCase):
real_ingestion_rule = {
'Arn': 'arn:aws:events:eu-central-1:612888738066:rule/taiwan-taiwan-ingestor-prod',
'Des... | true | true |
f77188fa81045c1ecb9effa0600d54f05c103761 | 17,978 | py | Python | app_uniplan/views.py | illegalbyte/uniplan | 1507a79679d38814591dfbe1bfe8332b632a2290 | [
"MIT"
] | null | null | null | app_uniplan/views.py | illegalbyte/uniplan | 1507a79679d38814591dfbe1bfe8332b632a2290 | [
"MIT"
] | null | null | null | app_uniplan/views.py | illegalbyte/uniplan | 1507a79679d38814591dfbe1bfe8332b632a2290 | [
"MIT"
] | null | null | null | from pprint import pprint
from django.http import QueryDict
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from django.urls import reverse_lazy
from django.views import generic
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators imp... | 41.809302 | 230 | 0.749249 | from pprint import pprint
from django.http import QueryDict
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from django.urls import reverse_lazy
from django.views import generic
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators imp... | true | true |
f77189396acba7892c20013cdb23372ceec166e4 | 3,848 | py | Python | tests/views/test_impersonation.py | feanil/django-rest-framework-jwt | 435a3f4fdb3102fc904eaca51fcf221db424ef86 | [
"MIT"
] | 1 | 2020-06-04T12:47:45.000Z | 2020-06-04T12:47:45.000Z | tests/views/test_impersonation.py | valohai/django-rest-framework-jwt | 4fb16a2d97247512ef4e7d63fcc53b7db8530cc8 | [
"MIT"
] | null | null | null | tests/views/test_impersonation.py | valohai/django-rest-framework-jwt | 4fb16a2d97247512ef4e7d63fcc53b7db8530cc8 | [
"MIT"
] | 1 | 2020-06-01T17:17:08.000Z | 2020-06-01T17:17:08.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework_jwt.settings import api_se... | 28.716418 | 84 | 0.742204 |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework_jwt.settings import api_settings
def test_superu... | true | true |
f7718999d91d26a52f1764ef7e35f30ba069bef4 | 17,514 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/vmware/plugins/modules/vmware_drs_group.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 7 | 2021-11-16T04:05:42.000Z | 2022-02-19T21:14:29.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/vmware/plugins/modules/vmware_drs_group.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/vmware/plugins/modules/vmware_drs_group.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2022-03-01T05:43:07.000Z | 2022-03-01T05:43:07.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Karsten Kaj Jakobsen <kj@patientsky.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
autho... | 30.512195 | 159 | 0.585931 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
author:
- "Karsten Kaj Jakobsen (@karstenjakobsen)"
description:
- "This module can be used to create VM/Host groups in a given cluster. Creates a vm group if C(vms) is set. Creates a host group if C(... | true | true |
f77189d606aa63fd9b0340c2ac609678cf9dc9e5 | 564 | py | Python | Interviews/second/tests/test_second.py | makkahwi/data-structures-and-algorithms | 06551786258bb7dabb9b0ab07c0f80ff78abca41 | [
"MIT"
] | null | null | null | Interviews/second/tests/test_second.py | makkahwi/data-structures-and-algorithms | 06551786258bb7dabb9b0ab07c0f80ff78abca41 | [
"MIT"
] | null | null | null | Interviews/second/tests/test_second.py | makkahwi/data-structures-and-algorithms | 06551786258bb7dabb9b0ab07c0f80ff78abca41 | [
"MIT"
] | null | null | null | from second.second import checkLinkedList, linked_list
import pytest
def test_1(list1):
actual = checkLinkedList(list1)
expected = False
assert actual == expected
def test_2(list2):
actual = checkLinkedList(list2)
expected = True
assert actual == expected
@pytest.fixture
def list1():
l... | 17.090909 | 54 | 0.661348 | from second.second import checkLinkedList, linked_list
import pytest
def test_1(list1):
actual = checkLinkedList(list1)
expected = False
assert actual == expected
def test_2(list2):
actual = checkLinkedList(list2)
expected = True
assert actual == expected
@pytest.fixture
def list1():
l... | true | true |
f7718acbeac1c2c4cc7fba4a7c339879990f06ce | 24,088 | py | Python | lib/ManyHellos/ManyHellosServer.py | sean-mccorkle/ManyHellos | be42358e08ac119e7ce8fd84bdfb73cd9578964a | [
"MIT"
] | null | null | null | lib/ManyHellos/ManyHellosServer.py | sean-mccorkle/ManyHellos | be42358e08ac119e7ce8fd84bdfb73cd9578964a | [
"MIT"
] | null | null | null | lib/ManyHellos/ManyHellosServer.py | sean-mccorkle/ManyHellos | be42358e08ac119e7ce8fd84bdfb73cd9578964a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... | 37.578783 | 151 | 0.544462 | from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, InvalidRequestError
from jsonrpcbase import Server... | false | true |
f7718c2d4335120c8b549d4bd04ab1038fac0fc4 | 3,395 | py | Python | scripts/beta_diversity_stats.py | dcdanko/MetaSUB_CAP | db5672b0206afb3ffe3204b0577a4a5f84b9bcd4 | [
"MIT"
] | 20 | 2017-11-02T13:36:16.000Z | 2021-07-23T12:44:28.000Z | scripts/beta_diversity_stats.py | dcdanko/MetaSUB_CAP | db5672b0206afb3ffe3204b0577a4a5f84b9bcd4 | [
"MIT"
] | 30 | 2018-02-22T18:25:02.000Z | 2019-11-06T15:03:34.000Z | scripts/beta_diversity_stats.py | dcdanko/MetaSUB_CAP | db5672b0206afb3ffe3204b0577a4a5f84b9bcd4 | [
"MIT"
] | 9 | 2018-04-26T22:12:08.000Z | 2020-08-06T01:04:54.000Z | #! /usr/bin/env python3
import sys
import click
from scipy.spatial.distance import pdist, squareform
from scipy.stats import gmean, entropy
from numpy.linalg import norm
import numpy as np
from math import sqrt
from json import dumps as jdumps
import pandas as pd
class LevelNotFoundException(Exception):
pass
... | 25.719697 | 76 | 0.57673 |
import sys
import click
from scipy.spatial.distance import pdist, squareform
from scipy.stats import gmean, entropy
from numpy.linalg import norm
import numpy as np
from math import sqrt
from json import dumps as jdumps
import pandas as pd
class LevelNotFoundException(Exception):
pass
def checkLevel(taxon, le... | true | true |
f7718c4a20e0764a91cf7f9d449c634f2aebcc1d | 368 | py | Python | torch/distributed/constants.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 40 | 2021-06-01T07:37:59.000Z | 2022-03-25T01:42:09.000Z | torch/distributed/constants.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 14 | 2021-06-01T11:52:46.000Z | 2022-03-25T02:13:08.000Z | torch/distributed/constants.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 7 | 2021-07-20T19:34:26.000Z | 2022-03-13T21:07:36.000Z | from datetime import timedelta
# Default process group wide timeout, if applicable.
# This only applies to the gloo and nccl backends
# (only if NCCL_BLOCKING_WAIT is set to 1). To make an attempt at
# backwards compatibility with THD, we use an extraordinarily high default
# timeout, given that THD did not have timeo... | 40.888889 | 74 | 0.793478 | from datetime import timedelta
default_pg_timeout = timedelta(minutes=30)
| true | true |
f7718c4b94cc83f21b529ca47e4d17dd3f45276f | 42,428 | py | Python | momepy/graph.py | PratyushTripathy/momepy | eac89eaff63dd6cb35dfd9a736981723ec77f496 | [
"MIT"
] | null | null | null | momepy/graph.py | PratyushTripathy/momepy | eac89eaff63dd6cb35dfd9a736981723ec77f496 | [
"MIT"
] | null | null | null | momepy/graph.py | PratyushTripathy/momepy | eac89eaff63dd6cb35dfd9a736981723ec77f496 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# connectivity.py
# definitions of connectivity characters
import math
import warnings
import networkx as nx
import numpy as np
from tqdm import tqdm
__all__ = [
"node_degree",
"meshedness",
"mean_node_dist",
"cds_length",
"mean_node_degree",
"pro... | 30.924198 | 113 | 0.623857 |
import math
import warnings
import networkx as nx
import numpy as np
from tqdm import tqdm
__all__ = [
"node_degree",
"meshedness",
"mean_node_dist",
"cds_length",
"mean_node_degree",
"proportion",
"cyclomatic",
"edge_node_ratio",
"gamma",
"clustering",
"local_closeness_ce... | true | true |
f7718cda3c74ca8a445f827b9c5173a4474abbdf | 2,459 | py | Python | build/plugins/modules/kafka_info.py | wcosta/ansible-kafka-admin | 25c9b60c29b5728042e248eac1427ed24df0f74c | [
"Apache-2.0"
] | null | null | null | build/plugins/modules/kafka_info.py | wcosta/ansible-kafka-admin | 25c9b60c29b5728042e248eac1427ed24df0f74c | [
"Apache-2.0"
] | null | null | null | build/plugins/modules/kafka_info.py | wcosta/ansible-kafka-admin | 25c9b60c29b5728042e248eac1427ed24df0f74c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module for Kafka information
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# import module snippets
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_exception
from kafk... | 26.44086 | 108 | 0.660024 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_exception
from kafka.errors import KafkaError
from ansible_collections.StephenSorriaux.ansible_kafka_admin.plugins.module_utils.ka... | true | true |
f7718d2b1b4fba5aef60c29bd3db7f5dd08b8381 | 811 | py | Python | modules/windows_jumplist/lib/yjDateTime.py | naaya17/carpe | fa2e3cfebe20f8839c985e5b9b78b538800172a1 | [
"Apache-2.0"
] | 56 | 2019-02-07T06:21:45.000Z | 2022-03-21T08:19:24.000Z | modules/windows_jumplist/lib/yjDateTime.py | naaya17/carpe | fa2e3cfebe20f8839c985e5b9b78b538800172a1 | [
"Apache-2.0"
] | 5 | 2020-05-25T17:29:00.000Z | 2021-12-13T20:49:08.000Z | modules/windows_jumplist/lib/yjDateTime.py | naaya17/carpe | fa2e3cfebe20f8839c985e5b9b78b538800172a1 | [
"Apache-2.0"
] | 31 | 2019-03-13T10:23:49.000Z | 2021-11-04T12:14:58.000Z | #
# yjDateTime.py, 200506
#
from ctypes import *
from modules.windows_jumplist.lib import Filetimes
import datetime
def filetime_to_datetime(filetime, inchour = 0):
''' v = filetime_to_datetime(ft, 9).isoformat() '''
if __debug__: assert type(filetime) is int
try:
return Filetimes.filetime_to_dt(filetime) + ... | 26.16129 | 81 | 0.695438 | from ctypes import *
from modules.windows_jumplist.lib import Filetimes
import datetime
def filetime_to_datetime(filetime, inchour = 0):
if __debug__: assert type(filetime) is int
try:
return Filetimes.filetime_to_dt(filetime) + datetime.timedelta(hours=inchour)
except Exception:
return None
class FILET... | true | true |
f7718d9397cb59549b128664b6e36077bddc8aae | 377 | py | Python | keypad/driver/actions/utils.py | lnixdo2s/saiga | dba093e66696b556f97269585bc4bc0ef51c5763 | [
"MIT"
] | null | null | null | keypad/driver/actions/utils.py | lnixdo2s/saiga | dba093e66696b556f97269585bc4bc0ef51c5763 | [
"MIT"
] | null | null | null | keypad/driver/actions/utils.py | lnixdo2s/saiga | dba093e66696b556f97269585bc4bc0ef51c5763 | [
"MIT"
] | null | null | null | from actions.action import AbstractAction, CombinedAction, WrappedAction, SequenceAction
def COMBINE(*actions: list[AbstractAction]):
return CombinedAction(actions)
def WRAP(outer_action: AbstractAction, inner_action: AbstractAction):
return WrappedAction(outer_action, inner_action)
def SEQUENCE(*actions: l... | 31.416667 | 88 | 0.809019 | from actions.action import AbstractAction, CombinedAction, WrappedAction, SequenceAction
def COMBINE(*actions: list[AbstractAction]):
return CombinedAction(actions)
def WRAP(outer_action: AbstractAction, inner_action: AbstractAction):
return WrappedAction(outer_action, inner_action)
def SEQUENCE(*actions: l... | true | true |
f7718e584f5e17d67cb10bcafb5830de4684d71e | 6,658 | py | Python | python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py | yangguohao/Paddle | 81622708a7c904092185ef04897b1e81629f51a6 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py | yangguohao/Paddle | 81622708a7c904092185ef04897b1e81629f51a6 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/auto_parallel/test_dist_context.py | yangguohao/Paddle | 81622708a7c904092185ef04897b1e81629f51a6 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 32.478049 | 103 | 0.621208 |
import unittest
import os
import json
import paddle
import numpy as np
import paddle.nn as nn
import paddle.utils as utils
import paddle.static as static
import paddle.nn.functional as F
from paddle.distributed import fleet
import paddle.distributed.auto_parallel as auto
from paddle.distributed.auto_parallel.dist_co... | true | true |
f7718e97df643682523f6b5539303a734b60eed0 | 935 | py | Python | plugins/pagerduty/komand_pagerduty/actions/send_resolve_event/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/pagerduty/komand_pagerduty/actions/send_resolve_event/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/pagerduty/komand_pagerduty/actions/send_resolve_event/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import insightconnect_plugin_runtime
from .schema import SendResolveEventInput, SendResolveEventOutput
# Custom imports below
import pypd
class SendResolveEvent(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="send_resolve_event",
... | 26.714286 | 65 | 0.57754 | import insightconnect_plugin_runtime
from .schema import SendResolveEventInput, SendResolveEventOutput
import pypd
class SendResolveEvent(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="send_resolve_event",
description="Resolv... | true | true |
f7718f06a410c3af1c4e02e9ba5ec796eb9234cf | 57,422 | py | Python | python/pyarrow/tests/test_convert_pandas.py | siddharthteotia/arrow | b33dfd9c6bd800308bb1619b237dbf24dea159be | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_convert_pandas.py | siddharthteotia/arrow | b33dfd9c6bd800308bb1619b237dbf24dea159be | [
"Apache-2.0"
] | 2 | 2017-10-18T20:01:51.000Z | 2017-11-15T14:54:22.000Z | python/pyarrow/tests/test_convert_pandas.py | siddharthteotia/arrow | b33dfd9c6bd800308bb1619b237dbf24dea159be | [
"Apache-2.0"
] | 1 | 2021-10-05T00:37:00.000Z | 2021-10-05T00:37:00.000Z | # -*- coding: utf-8 -*-
# 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
# "... | 34.885784 | 79 | 0.559873 |
from collections import OrderedDict
from datetime import date, datetime, time, timedelta
import decimal
import json
import pytest
import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.util.testing as tm
from pyarrow.compat import u, PY2
import pyarrow as pa
import pyarrow.types as patyp... | true | true |
f7718f42e19e9b810b47611f93c55d0d932db479 | 61,524 | py | Python | diluvian/volumes.py | pattonw/diluvian | 3df1e0666f6e65c7719f703e629239b7f0493f86 | [
"MIT"
] | 20 | 2017-05-31T02:31:12.000Z | 2021-08-09T15:01:17.000Z | diluvian/volumes.py | pattonw/diluvian | 3df1e0666f6e65c7719f703e629239b7f0493f86 | [
"MIT"
] | 32 | 2017-05-22T23:59:47.000Z | 2022-02-09T23:27:31.000Z | diluvian/volumes.py | pattonw/diluvian | 3df1e0666f6e65c7719f703e629239b7f0493f86 | [
"MIT"
] | 14 | 2017-06-01T14:20:40.000Z | 2022-01-12T15:11:05.000Z | # -*- coding: utf-8 -*-
"""Volumes of raw image and labeled object data."""
from __future__ import division
from collections import namedtuple
import csv
import logging
import os
import re
import h5py
import math
import numpy as np
from PIL import Image
import pytoml as toml
import requests
from scipy import ndimag... | 39.162317 | 120 | 0.60591 |
from __future__ import division
from collections import namedtuple
import csv
import logging
import os
import re
import h5py
import math
import numpy as np
from PIL import Image
import pytoml as toml
import requests
from scipy import ndimage
import six
from six.moves import range as xrange
import pyn5
from .config... | true | true |
f7719180b85ca40e5a4b36c435fd2b913828e6b5 | 6,888 | py | Python | salt/modules/win_network.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | 1 | 2015-08-20T21:55:17.000Z | 2015-08-20T21:55:17.000Z | salt/modules/win_network.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | null | null | null | salt/modules/win_network.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Module for gathering and managing network information
'''
# Import salt libs
import salt.utils
try:
import salt.utils.winapi
HAS_DEPENDENCIES = True
except ImportError:
HAS_DEPENDENCIES = False
# Import 3rd party libraries
try:
import wmi # pylint: disable=W0611
except Im... | 23.670103 | 77 | 0.562427 |
import salt.utils
try:
import salt.utils.winapi
HAS_DEPENDENCIES = True
except ImportError:
HAS_DEPENDENCIES = False
try:
import wmi except ImportError:
HAS_DEPENDENCIES = False
__virtualname__ = 'network'
def __virtual__():
if salt.utils.is_windows() and HAS_DEPENDENCIES is True:
... | true | true |
f77191a2c281b11f7fe343fcd32b877922361bb9 | 874 | py | Python | one_fm/one_fm/doctype/okr_performance_profile/okr_performance_profile.py | askmetoo/One-FM | c93ed63695a3e62ee8129bd9adf563116b749030 | [
"MIT"
] | 16 | 2021-06-14T23:56:47.000Z | 2022-03-22T12:05:06.000Z | one_fm/one_fm/doctype/okr_performance_profile/okr_performance_profile.py | askmetoo/One-FM | c93ed63695a3e62ee8129bd9adf563116b749030 | [
"MIT"
] | 119 | 2020-08-17T16:27:45.000Z | 2022-03-28T12:42:56.000Z | one_fm/one_fm/doctype/okr_performance_profile/okr_performance_profile.py | askmetoo/One-FM | c93ed63695a3e62ee8129bd9adf563116b749030 | [
"MIT"
] | 12 | 2021-05-16T13:35:40.000Z | 2022-02-21T12:41:04.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, omar jaber and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class OKRPerformanceProfile(Document):
def validate(self):
self.validate_... | 38 | 145 | 0.779176 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class OKRPerformanceProfile(Document):
def validate(self):
self.validate_kr_time_frame_total()
def validate_kr_time_frame_total(self):
if self.objectives and self.key_results:
for objective ... | true | true |
f77192f1b3887cc4c90c277fe9e2a3e9058cc305 | 350 | py | Python | estore/account/admin.py | 99649952/estore | e4b044abbdff414a81f6b6a9a16474c424a5b42e | [
"Apache-2.0"
] | null | null | null | estore/account/admin.py | 99649952/estore | e4b044abbdff414a81f6b6a9a16474c424a5b42e | [
"Apache-2.0"
] | null | null | null | estore/account/admin.py | 99649952/estore | e4b044abbdff414a81f6b6a9a16474c424a5b42e | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import User
from .models import UserInfo
class UserAdmin(admin.ModelAdmin):
list_display = ('email', 'date_joined', 'user_info')
class UserInfoAdmin(admin.ModelAdmin):
list_display = ('name', 'qq', 'mobile')
admin.site.register(User, UserAdmin)
admin.site.regi... | 21.875 | 56 | 0.751429 | from django.contrib import admin
from .models import User
from .models import UserInfo
class UserAdmin(admin.ModelAdmin):
list_display = ('email', 'date_joined', 'user_info')
class UserInfoAdmin(admin.ModelAdmin):
list_display = ('name', 'qq', 'mobile')
admin.site.register(User, UserAdmin)
admin.site.regi... | true | true |
f77194409a95c7d49be34dd2f9773464a4a90469 | 2,839 | py | Python | DemoMiscItems.py | P3D-Space-Tech-Demo/Section-3-Space-Station | 1751f61e2eb35343909347014973695478c682a7 | [
"BSD-3-Clause"
] | null | null | null | DemoMiscItems.py | P3D-Space-Tech-Demo/Section-3-Space-Station | 1751f61e2eb35343909347014973695478c682a7 | [
"BSD-3-Clause"
] | null | null | null | DemoMiscItems.py | P3D-Space-Tech-Demo/Section-3-Space-Station | 1751f61e2eb35343909347014973695478c682a7 | [
"BSD-3-Clause"
] | null | null | null | from panda3d.core import PandaNode
from CommonValues import *
import math
class Door():
def __init__(self, modelNP = None):
self.root = render.attachNewNode(PandaNode("obj"))
self.isOpen = False
self.movementTimer = 0
self.movementDuration = 0
self.movementSpeed = 1.5
... | 28.39 | 97 | 0.586474 | from panda3d.core import PandaNode
from CommonValues import *
import math
class Door():
def __init__(self, modelNP = None):
self.root = render.attachNewNode(PandaNode("obj"))
self.isOpen = False
self.movementTimer = 0
self.movementDuration = 0
self.movementSpeed = 1.5
... | true | true |
f771949f99840d68f34113d8cf6a412c08447ffa | 1,668 | py | Python | generate_graph_defs.py | SRechenberger/Masterarbeit_Code | 8a7b213a15d49ae58b103e6f00024afa226002df | [
"MIT"
] | null | null | null | generate_graph_defs.py | SRechenberger/Masterarbeit_Code | 8a7b213a15d49ae58b103e6f00024afa226002df | [
"MIT"
] | 4 | 2018-12-10T14:54:25.000Z | 2018-12-19T20:53:30.000Z | generate_graph_defs.py | SRechenberger/sls_entropy | 8a7b213a15d49ae58b103e6f00024afa226002df | [
"MIT"
] | null | null | null | import argparse
from src.formula import Formula, Assignment
from src.solver.utils import Falselist
from src.solver.gsat import gsat_distribution, GSATContext
from src.solver.walksat import walksat_distribution, DefensiveContext
from src.solver.probsat import probsat_distribution
parser = argparse.ArgumentParser()
grp ... | 29.263158 | 79 | 0.660671 | import argparse
from src.formula import Formula, Assignment
from src.solver.utils import Falselist
from src.solver.gsat import gsat_distribution, GSATContext
from src.solver.walksat import walksat_distribution, DefensiveContext
from src.solver.probsat import probsat_distribution
parser = argparse.ArgumentParser()
grp ... | true | true |
f77194ef99e1ec7899793614aa2e875869114c0f | 7,688 | py | Python | tests/src/stanpy/test_reduction.py | DavidNaizheZhou/stanpy | 257072bd52154e9e4d68be957fd12eee1ad3dc56 | [
"MIT"
] | null | null | null | tests/src/stanpy/test_reduction.py | DavidNaizheZhou/stanpy | 257072bd52154e9e4d68be957fd12eee1ad3dc56 | [
"MIT"
] | null | null | null | tests/src/stanpy/test_reduction.py | DavidNaizheZhou/stanpy | 257072bd52154e9e4d68be957fd12eee1ad3dc56 | [
"MIT"
] | 1 | 2022-01-30T17:25:38.000Z | 2022-01-30T17:25:38.000Z | import stanpy as stp
import numpy as np
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
def test_multiple_w0():
EI = 32000 # kN/m2
l = 3 # m
hinged_support = {"w": 0, "M": 0}
roller_support = {"w": 0, "M": 0, "H": 0}
fixed_support = {"w": 0, "phi": 0}
s1 = {"EI": EI, "l": ... | 28.058394 | 135 | 0.512747 | import stanpy as stp
import numpy as np
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
def test_multiple_w0():
EI = 32000 l = 3
hinged_support = {"w": 0, "M": 0}
roller_support = {"w": 0, "M": 0, "H": 0}
fixed_support = {"w": 0, "phi": 0}
s1 = {"EI": EI, "l": l, "bc_i": h... | true | true |
f77195038d1c2534f003186f8ef62219831378a8 | 133,168 | py | Python | environment/lib/python3.7/site-packages/plotly/graph_objs/layout/_yaxis.py | sid-the-coder/Easy-Data-Analysis-With-Pandas | 5ae2a867e5a548e34f28aec89e49c361071b872c | [
"MIT"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | environment/lib/python3.7/site-packages/plotly/graph_objs/layout/_yaxis.py | sid-the-coder/Easy-Data-Analysis-With-Pandas | 5ae2a867e5a548e34f28aec89e49c361071b872c | [
"MIT"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | environment/lib/python3.7/site-packages/plotly/graph_objs/layout/_yaxis.py | sid-the-coder/Easy-Data-Analysis-With-Pandas | 5ae2a867e5a548e34f28aec89e49c361071b872c | [
"MIT"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class YAxis(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.yaxis"
_valid_props = {
"anchor",
"automargin"... | 37.628709 | 89 | 0.569739 | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class YAxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout"
_path_str = "layout.yaxis"
_valid_props = {
"anchor",
"automargin",
"autorange",
"calendar",... | true | true |
f7719561aa883fa5a7a9cf076238358bf802d62b | 534 | py | Python | badou/review/day01/map.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | badou/review/day01/map.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | badou/review/day01/map.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
@version: v1.0
@author: Richard
@license: Apache Licence
@contact: billions.richard@qq.com
@site:
@software: PyCharm
@file: map.py
@time: 2019/2/4 11:16
"""
from pprint import pprint as pp
import sys
import re
for line in sys.stdin:
for raw_word in line.split():
words = r... | 18.413793 | 44 | 0.558052 |
from pprint import pprint as pp
import sys
import re
for line in sys.stdin:
for raw_word in line.split():
words = re.findall(r'\w+', raw_word)
if words:
word = words[0].lower()
else:
continue
if not word:
continue
else:
print... | true | true |
f771956406d684108789c255d473287e66945595 | 9,348 | py | Python | c7n/reports/csvout.py | sixfeetup/cloud-custodian | ead8b158371d82324ec2f9d85f0f324b3d2de591 | [
"Apache-2.0"
] | 1 | 2017-06-26T18:30:22.000Z | 2017-06-26T18:30:22.000Z | c7n/reports/csvout.py | sixfeetup/cloud-custodian | ead8b158371d82324ec2f9d85f0f324b3d2de591 | [
"Apache-2.0"
] | null | null | null | c7n/reports/csvout.py | sixfeetup/cloud-custodian | ead8b158371d82324ec2f9d85f0f324b3d2de591 | [
"Apache-2.0"
] | 1 | 2019-01-26T03:51:41.000Z | 2019-01-26T03:51:41.000Z | # Copyright 2015-2017 Capital One Services, 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 ... | 31.688136 | 95 | 0.627942 | from __future__ import absolute_import, division, print_function, unicode_literals
from concurrent.futures import as_completed
import csv
from datetime import datetime
import gzip
import io
import json
import jmespath
import logging
import os
from tabulate import tabulate
import six
from botocore.compat import Order... | true | true |
f77195bd950e1e9c4af734f41cd96e65c53d4ddd | 987 | py | Python | webdev/produtos/tests/test_produtos_post.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | webdev/produtos/tests/test_produtos_post.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | 103 | 2021-04-25T21:28:11.000Z | 2022-03-15T01:36:31.000Z | webdev/produtos/tests/test_produtos_post.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | import pytest
from django.urls import reverse
from webdev.produtos.models import Produto, Categoria
from django.contrib.auth.models import User
# Novo Produto
@pytest.fixture
def resposta_novo_produto(client, db):
usr = User.objects.create_user(username='TestUser', password='MinhaSenha123')
client.login(userna... | 32.9 | 81 | 0.724417 | import pytest
from django.urls import reverse
from webdev.produtos.models import Produto, Categoria
from django.contrib.auth.models import User
@pytest.fixture
def resposta_novo_produto(client, db):
usr = User.objects.create_user(username='TestUser', password='MinhaSenha123')
client.login(username='TestUser', ... | true | true |
f77195efa84aed9d21199bd01d16619fd6d2d2ca | 711 | py | Python | module_05_files/psl_05.04_tempfile_02.py | CodingGearsCourses/Python-3-Standard-Library-Essentials | 8b80bc8b77fa477b6ccbe2886ed9239c2defdfda | [
"Apache-2.0"
] | null | null | null | module_05_files/psl_05.04_tempfile_02.py | CodingGearsCourses/Python-3-Standard-Library-Essentials | 8b80bc8b77fa477b6ccbe2886ed9239c2defdfda | [
"Apache-2.0"
] | null | null | null | module_05_files/psl_05.04_tempfile_02.py | CodingGearsCourses/Python-3-Standard-Library-Essentials | 8b80bc8b77fa477b6ccbe2886ed9239c2defdfda | [
"Apache-2.0"
] | null | null | null | # --------------------------------
# CodingGears.io
# --------------------------------
# tempfile — Generate temporary files and directories
# TODO: Imports
import tempfile
# TODO: Create a temporary file
temp_file = tempfile.NamedTemporaryFile()
# TODO: Display temp file info
print("File created : {}".format(te... | 22.21875 | 54 | 0.62166 |
import tempfile
temp_file = tempfile.NamedTemporaryFile()
print("File created : {}".format(temp_file))
print("Type : {}".format(type(temp_file)))
print("Name of the file : {}".format(temp_file.name))
temp_file.write(b"1: Writing to the temp file...\n")
temp_file.write(b"2: Writing to the temp file.... | true | true |
f771984192550d4f8a886c815f7fc8ceb04572bd | 127 | py | Python | hellolambda.py | justmaxfield/public_lambda | 628c356ed52d8e1309773f28fab4daba27012e12 | [
"MIT"
] | null | null | null | hellolambda.py | justmaxfield/public_lambda | 628c356ed52d8e1309773f28fab4daba27012e12 | [
"MIT"
] | null | null | null | hellolambda.py | justmaxfield/public_lambda | 628c356ed52d8e1309773f28fab4daba27012e12 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 02 03:42:20 2016
@author: JUSTIN
"""
#Test github push
print('Hello Lambda.') | 12.7 | 35 | 0.622047 |
print('Hello Lambda.') | true | true |
f771984f9958d304e3df2ae7691de28dacb3e64c | 1,950 | py | Python | python/tests/testdata/__init__.py | chronossc/python-phonenumbers | 2ea483bfa9ac19144183dadaa7cafb2772a72bfe | [
"Apache-2.0"
] | 1 | 2016-11-20T00:50:06.000Z | 2016-11-20T00:50:06.000Z | python/tests/testdata/__init__.py | chronossc/python-phonenumbers | 2ea483bfa9ac19144183dadaa7cafb2772a72bfe | [
"Apache-2.0"
] | null | null | null | python/tests/testdata/__init__.py | chronossc/python-phonenumbers | 2ea483bfa9ac19144183dadaa7cafb2772a72bfe | [
"Apache-2.0"
] | null | null | null | """Auto-generated file, do not edit by hand."""
# Copyright (C) 2010-2013 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | 32.5 | 127 | 0.660513 |
from phonenumbers.phonemetadata import PhoneMetadata
_AVAILABLE_REGION_CODES = ['AD','AE','AO','AR','AU','BR','BS','BY','DE','GB','IT','JP','KR','MX','NZ','PL','RE','SG','US','YT']
_AVAILABLE_NONGEO_COUNTRY_CODES = [800, 979]
def _load_region(code):
__import__("region_%s" % code, globals(), locals(),
... | true | true |
f77198c56a13537e18ec6100532f52f45a666dd7 | 6,019 | py | Python | scrapers/main.py | OCHA-DAP/hdx-scraper-arabstate-viz | 8947b26dcba6fe277c415cd7f1ae01fb164b8c85 | [
"MIT"
] | null | null | null | scrapers/main.py | OCHA-DAP/hdx-scraper-arabstate-viz | 8947b26dcba6fe277c415cd7f1ae01fb164b8c85 | [
"MIT"
] | null | null | null | scrapers/main.py | OCHA-DAP/hdx-scraper-arabstate-viz | 8947b26dcba6fe277c415cd7f1ae01fb164b8c85 | [
"MIT"
] | null | null | null | import logging
from hdx.location.adminone import AdminOne
from hdx.location.country import Country
from hdx.scraper.configurable.aggregator import Aggregator
from hdx.scraper.outputs.update_tabs import (
get_regional_rows,
get_toplevel_rows,
update_national,
update_regional,
update_sources,
upd... | 30.246231 | 86 | 0.660243 | import logging
from hdx.location.adminone import AdminOne
from hdx.location.country import Country
from hdx.scraper.configurable.aggregator import Aggregator
from hdx.scraper.outputs.update_tabs import (
get_regional_rows,
get_toplevel_rows,
update_national,
update_regional,
update_sources,
upd... | true | true |
f77199d2c5ae30685cc69cc73b9d82318fda59cc | 1,425 | py | Python | custom_components/tahoma/lock.py | iMicknl/ha-tahoma | 4e0433d44b87678493655e9ebc9818cfa3ed95cc | [
"MIT"
] | 130 | 2020-06-04T15:32:53.000Z | 2022-03-11T20:27:29.000Z | custom_components/tahoma/lock.py | dmaasland/ha-tahoma | 180d190e10f450681c1497215455d33dc9523771 | [
"MIT"
] | 514 | 2020-06-04T10:56:48.000Z | 2022-03-31T17:38:54.000Z | custom_components/tahoma/lock.py | iMicknl/ha-tahoma | 4e0433d44b87678493655e9ebc9818cfa3ed95cc | [
"MIT"
] | 34 | 2020-06-09T19:43:34.000Z | 2022-03-30T18:36:58.000Z | """Support for Overkiz lock."""
from homeassistant.components.lock import DOMAIN as LOCK, LockEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_LOCKED
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from ... | 29.6875 | 88 | 0.737544 | from homeassistant.components.lock import DOMAIN as LOCK, LockEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_LOCKED
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN
from .entit... | true | true |
f7719ba0a1d8e457c1a6118af0fd668633bcc659 | 570 | py | Python | examples/CheckBoxDemo.py | anthrotype/dialogKit | f63226001359bf9044f92c7f87fb3eccc35d9e9e | [
"MIT"
] | 21 | 2015-01-16T05:10:02.000Z | 2021-06-11T20:48:15.000Z | examples/CheckBoxDemo.py | anthrotype/dialogKit | f63226001359bf9044f92c7f87fb3eccc35d9e9e | [
"MIT"
] | 1 | 2019-09-09T12:10:27.000Z | 2020-05-22T10:12:14.000Z | examples/CheckBoxDemo.py | anthrotype/dialogKit | f63226001359bf9044f92c7f87fb3eccc35d9e9e | [
"MIT"
] | 3 | 2015-05-07T19:35:50.000Z | 2016-01-14T02:31:53.000Z | from dialogKit import *
class CheckBoxDemo(object):
def __init__(self):
self.w = ModalDialog((200, 120), 'CheckBox Demo')
self.w.checkBox1 = CheckBox((10, 10, 180, 20), 'CheckBox 1', callback=self.checkBox1Callback, value=True)
self.w.checkBox2 = CheckBox((10, 40, 180, 20), 'CheckBox 2... | 31.666667 | 113 | 0.640351 | from dialogKit import *
class CheckBoxDemo(object):
def __init__(self):
self.w = ModalDialog((200, 120), 'CheckBox Demo')
self.w.checkBox1 = CheckBox((10, 10, 180, 20), 'CheckBox 1', callback=self.checkBox1Callback, value=True)
self.w.checkBox2 = CheckBox((10, 40, 180, 20), 'CheckBox 2... | false | true |
f7719ba94103311a811a808f277f2019e5e3296a | 5,550 | py | Python | tests/utils.py | fiatjaf/etleneum | e7eac5894c0ee6d7ad4e5b348fdc3892ce405011 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 11 | 2020-01-30T13:52:28.000Z | 2022-02-09T13:00:02.000Z | tests/utils.py | fiatjaf/etleneum | e7eac5894c0ee6d7ad4e5b348fdc3892ce405011 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-07-26T07:26:31.000Z | 2021-09-15T21:50:23.000Z | tests/utils.py | fiatjaf/etleneum | e7eac5894c0ee6d7ad4e5b348fdc3892ce405011 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2020-09-06T16:42:30.000Z | 2021-11-01T16:30:32.000Z | import re
import os
import time
import shlex
import logging
import subprocess
import threading
TIMEOUT = 5
def wait_for(success, timeout=TIMEOUT):
start_time = time.time()
interval = 0.25
while not success() and time.time() < start_time + timeout:
time.sleep(interval)
interval *= 2
... | 34.04908 | 88 | 0.561622 | import re
import os
import time
import shlex
import logging
import subprocess
import threading
TIMEOUT = 5
def wait_for(success, timeout=TIMEOUT):
start_time = time.time()
interval = 0.25
while not success() and time.time() < start_time + timeout:
time.sleep(interval)
interval *= 2
... | true | true |
f7719c71cc0d3a650732406cb141417057f5fd74 | 55,874 | py | Python | causalml/inference/tree/models.py | lleiou/causalml | 2d3cacacad5ed3b0e57b593803a33c61c554f3b2 | [
"Apache-2.0"
] | 1 | 2021-03-22T20:09:18.000Z | 2021-03-22T20:09:18.000Z | causalml/inference/tree/models.py | lleiou/causalml | 2d3cacacad5ed3b0e57b593803a33c61c554f3b2 | [
"Apache-2.0"
] | null | null | null | causalml/inference/tree/models.py | lleiou/causalml | 2d3cacacad5ed3b0e57b593803a33c61c554f3b2 | [
"Apache-2.0"
] | null | null | null | """
Forest of trees-based ensemble methods for Uplift modeling on Classification
Problem. Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``UpliftRandomForestClassifier`` base class implements different
variants of uplift models based on random forest... | 40.843567 | 120 | 0.57789 |
from collections import defaultdict
from joblib import Parallel, delayed
import multiprocessing as mp
import numpy as np
from packaging import version
import pandas as pd
import scipy.stats as stats
import sklearn
if version.parse(sklearn.__version__) >= version.parse('0.22.0'):
from sklearn.utils._testing import... | true | true |
f7719cf126e2af70a72f8bb09f9721d7ef88fa93 | 31,179 | py | Python | yokome/data/jpn/dictionary_to_rdbms.py | julianbetz/Yokome | 4e2f077cc6835a7719940e760cc351f47159bc36 | [
"Apache-2.0"
] | 1 | 2020-08-07T03:32:15.000Z | 2020-08-07T03:32:15.000Z | yokome/data/jpn/dictionary_to_rdbms.py | julianbetz/Yokome | 4e2f077cc6835a7719940e760cc351f47159bc36 | [
"Apache-2.0"
] | 11 | 2020-01-28T22:15:01.000Z | 2022-02-10T00:29:58.000Z | yokome/data/jpn/dictionary_to_rdbms.py | julianbetz/Yokome | 4e2f077cc6835a7719940e760cc351f47159bc36 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright 2019 Julian Betz
#
# 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 requi... | 52.578415 | 187 | 0.584785 |
import sys
import os
import click
from pathlib2 import Path
from xml.etree import ElementTree
import sqlite3 as sql
_PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.abspath(__file__))
+ '/../../..')
if _PROJECT_ROOT not in sys.path:
sys.path.append(_PROJECT_ROOT)
from yo... | true | true |
f7719d2147d4c2d2a48e8b77703de0b3d30a2eb5 | 1,023 | py | Python | tests/vtc-from-controlset.py | creativeprogramming/varnish-devicedetect | 486487cac8a28d47195baf951e20c9861ab9fe39 | [
"BSD-2-Clause"
] | 1 | 2019-06-12T19:55:06.000Z | 2019-06-12T19:55:06.000Z | tests/vtc-from-controlset.py | creativeprogramming/varnish-devicedetect | 486487cac8a28d47195baf951e20c9861ab9fe39 | [
"BSD-2-Clause"
] | null | null | null | tests/vtc-from-controlset.py | creativeprogramming/varnish-devicedetect | 486487cac8a28d47195baf951e20c9861ab9fe39 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
#
# Generate a varnishtest script to validate the preclassified
# U-A strings in the control set.
#
import sys
HEADER="""varnishtest "automatic test of control set"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
s... | 23.790698 | 77 | 0.604106 | import sys
HEADER="""varnishtest "automatic test of control set"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
sub vcl_recv { call devicedetect; }
sub vcl_deliver { set resp.http.X-UA-Device = req.http.X-UA-Device; }
} -st... | false | true |
f7719d84d64a946ff5ebba4d72712b864290ea5e | 842 | py | Python | spirit/topic/private/models.py | StepanBakshayev/Spirit | 28c053983d8323801d022c5314af7fdff4569228 | [
"MIT"
] | null | null | null | spirit/topic/private/models.py | StepanBakshayev/Spirit | 28c053983d8323801d022c5314af7fdff4569228 | [
"MIT"
] | null | null | null | spirit/topic/private/models.py | StepanBakshayev/Spirit | 28c053983d8323801d022c5314af7fdff4569228 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from .managers import TopicPrivateQuerySet
class TopicPrivate(models.Model):
user = models.For... | 28.066667 | 88 | 0.729216 |
from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from .managers import TopicPrivateQuerySet
class TopicPrivate(models.Model):
user = models.ForeignKey(settings.AUTH_US... | true | true |
f7719f0b1ae62f6abb2f410a7e0e153415b517a1 | 3,069 | py | Python | metabodirect/create_networks.py | Coayala/MetaboDirect | b86f98e60bb387f8f95186a6e7ba247c2eff10e6 | [
"MIT"
] | null | null | null | metabodirect/create_networks.py | Coayala/MetaboDirect | b86f98e60bb387f8f95186a6e7ba247c2eff10e6 | [
"MIT"
] | null | null | null | metabodirect/create_networks.py | Coayala/MetaboDirect | b86f98e60bb387f8f95186a6e7ba247c2eff10e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : Christian Ayala <cayalaortiz@email.arizona.edu>
Date : 2021-04-10
Purpose: Program to run MetaboDirect scripts
"""
import argparse
import os
import sys
import pandas as pd
import py4cytoscape as p4c
from metabodirect import preprocessing, r_control, transformations
# ----------... | 34.483146 | 125 | 0.569567 |
import argparse
import os
import sys
import pandas as pd
import py4cytoscape as p4c
from metabodirect import preprocessing, r_control, transformations
def get_args():
parser = argparse.ArgumentParser(
description='Program for creating molecular transformation networks, based on previously calculated tr... | true | true |
f7719f9cf762efeec9e4cb3e32aa5890e922bb7a | 6,806 | py | Python | couler/argo.py | xinbinhuang/couler | 89bf497f79d1a0900df3ea748935ea9e57989654 | [
"Apache-2.0"
] | null | null | null | couler/argo.py | xinbinhuang/couler | 89bf497f79d1a0900df3ea748935ea9e57989654 | [
"Apache-2.0"
] | null | null | null | couler/argo.py | xinbinhuang/couler | 89bf497f79d1a0900df3ea748935ea9e57989654 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Couler Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 28.7173 | 114 | 0.683221 |
import atexit
import logging
import pyaml
import yaml
from kubernetes import client as k8s_client
from kubernetes import config
from couler.argo_submitter import ArgoSubmitter
from couler.core import states from couler.core.config import config_workflow from couler.core.constants import * from couler.core.constan... | true | true |
f7719fc60eb23047c048be0009582f6bb2e45bc3 | 378 | py | Python | Mundo 1/ex008.py | viniciusbonito/CeV-Python-Exercicios | 6182421332f6f0c0a567c3e125fdc05736fa6281 | [
"MIT"
] | null | null | null | Mundo 1/ex008.py | viniciusbonito/CeV-Python-Exercicios | 6182421332f6f0c0a567c3e125fdc05736fa6281 | [
"MIT"
] | null | null | null | Mundo 1/ex008.py | viniciusbonito/CeV-Python-Exercicios | 6182421332f6f0c0a567c3e125fdc05736fa6281 | [
"MIT"
] | null | null | null | # Crie um programa que peça um valor em metros e o exiba em centímetros e milímetros
print('='*20)
print('Conversor de medidas')
print('='*20)
medida = float(input('Informe um valor em metros: '))
centimetros = medida * 100
milimetros = medida * 1000
print(f'Você informou {medida}m \n{medida}m corresponde a {centime... | 31.5 | 84 | 0.732804 |
print('='*20)
print('Conversor de medidas')
print('='*20)
medida = float(input('Informe um valor em metros: '))
centimetros = medida * 100
milimetros = medida * 1000
print(f'Você informou {medida}m \n{medida}m corresponde a {centimetros}cm')
print(f'{medida}m corresponde a {milimetros}mm') | true | true |
f7719fe9229d612d3c7517b9919da68189476857 | 3,989 | py | Python | futu/examples/tiny_quant/demo/tq_sample/TinyStrateSample.py | liteself/py-futu-api | a78f5b46f56d30fb82a42951823afea4b5ed1307 | [
"Apache-2.0"
] | 2 | 2020-03-18T09:54:03.000Z | 2020-05-15T08:13:33.000Z | futu/examples/tiny_quant/demo/tq_sample/TinyStrateSample.py | faruto/py-futu-api | cb274d5ab5387dca190b739d161f2bc8eabe073d | [
"Apache-2.0"
] | null | null | null | futu/examples/tiny_quant/demo/tq_sample/TinyStrateSample.py | faruto/py-futu-api | cb274d5ab5387dca190b739d161f2bc8eabe073d | [
"Apache-2.0"
] | 1 | 2022-03-26T08:59:12.000Z | 2022-03-26T08:59:12.000Z | # encoding: UTF-8
'''
实盘策略范例,接口用法见注释及范例代码
'''
import talib
from futu.examples.tiny_quant.tiny_quant_frame.TinyStrateBase import *
from futu.examples.tiny_quant.tiny_quant_frame.TinyQuantFrame import *
class TinyStrateSample(TinyStrateBase):
"""策略名称, setting.json中作为该策略配置的key"""
name = 'tiny_strate_sample'... | 29.548148 | 103 | 0.580597 |
import talib
from futu.examples.tiny_quant.tiny_quant_frame.TinyStrateBase import *
from futu.examples.tiny_quant.tiny_quant_frame.TinyQuantFrame import *
class TinyStrateSample(TinyStrateBase):
name = 'tiny_strate_sample'
symbol_pools = ['HK.00700', 'HK.00001']
def __init__(self):
super(TinyStr... | true | true |
f771a030a2ca760276867d1abdefac6e97b81831 | 3,552 | py | Python | test/integration/ggrc/access_control/rbac_factories/base.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/access_control/rbac_factories/base.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/access_control/rbac_factories/base.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Audit RBAC Factory."""
from ggrc.models import all_models
from integration.ggrc import Api
from integration.ggrc.models import factories
from integration.ggrc_workflows.models import factories as wf_facto... | 35.878788 | 79 | 0.677365 |
from ggrc.models import all_models
from integration.ggrc import Api
from integration.ggrc.models import factories
from integration.ggrc_workflows.models import factories as wf_factories
class BaseRBACFactory(object):
def setup_program_scope(self, user_id, acr, parent=None):
with factories.single_commit(... | true | true |
f771a1ede470385af4ee03ebcfdcb9dc0489a8d2 | 1,742 | py | Python | extern/blockly/i18n/tests.py | hongiklee/entryjs | 9f30048fe43c9410cd55c83a152d8711bf6afbe8 | [
"ECL-2.0",
"Apache-2.0"
] | 105 | 2016-03-17T15:05:37.000Z | 2022-03-28T02:41:17.000Z | extern/blockly/i18n/tests.py | hongiklee/entryjs | 9f30048fe43c9410cd55c83a152d8711bf6afbe8 | [
"ECL-2.0",
"Apache-2.0"
] | 566 | 2015-12-02T07:58:04.000Z | 2022-03-30T06:46:16.000Z | extern/blockly/i18n/tests.py | hongiklee/entryjs | 9f30048fe43c9410cd55c83a152d8711bf6afbe8 | [
"ECL-2.0",
"Apache-2.0"
] | 754 | 2016-01-28T09:09:55.000Z | 2022-03-30T11:57:04.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Tests of i18n scripts.
#
# Copyright 2013 Google Inc.
# https://blockly.googlecode.com/
#
# 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... | 36.291667 | 77 | 0.645809 |
import common
import re
import unittest
class TestSequenceFunctions(unittest.TestCase):
def test_insert_breaks(self):
spaces = re.compile(r'\s+|\\n')
def contains_all_chars(orig, result):
return re.sub(spaces, '', orig) == re.sub(spaces, '', result)
sentences = [u'Quay Pegman qua bên trái hoặc b... | true | true |
f771a2d30eb8471c832437bf86937aefc575d499 | 438 | py | Python | data/external/repositories_2to3/114534/kaggle-seizure-prediction-master/scripts/csv_flip.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/114534/kaggle-seizure-prediction-master/scripts/csv_flip.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/114534/kaggle-seizure-prediction-master/scripts/csv_flip.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z |
# 11/25/14: a simple script to "flip" all probabilities
import sys
from numpy import *
narg = len(sys.argv)
if narg != 2:
print("usage: %s <file>" % sys.argv[0])
exit(1)
path = sys.argv[1]
f = open(path)
X = f.readlines()
f.close()
N = len(X)
for n in range(N):
xcsv = X[n].split(',')
... | 14.6 | 56 | 0.520548 |
import sys
from numpy import *
narg = len(sys.argv)
if narg != 2:
print("usage: %s <file>" % sys.argv[0])
exit(1)
path = sys.argv[1]
f = open(path)
X = f.readlines()
f.close()
N = len(X)
for n in range(N):
xcsv = X[n].split(',')
assert( len(xcsv) == 1 )
x = 1 - float(xcsv[0])
... | true | true |
f771a2ec3a28255d02dff85276453015c25220f1 | 1,937 | py | Python | apps/accounts/functions.py | karpiq24/django-klima-kar | e62e79c66053749e249f55e1ab47f810f449f0aa | [
"MIT"
] | 2 | 2018-01-23T22:38:57.000Z | 2019-07-14T08:59:19.000Z | apps/accounts/functions.py | karpiq24/django-klima-kar | e62e79c66053749e249f55e1ab47f810f449f0aa | [
"MIT"
] | 237 | 2018-08-15T23:13:52.000Z | 2022-01-13T13:08:50.000Z | apps/accounts/functions.py | karpiq24/django-klima-kar | e62e79c66053749e249f55e1ab47f810f449f0aa | [
"MIT"
] | null | null | null | import os
import base64
from django.conf import settings
from django.contrib.gis.geoip2 import GeoIP2
from geoip2.errors import AddressNotFoundError
from pyotp import TOTP
from KlimaKar.email import mail_managers, get_email_message
def report_user_login(user_session):
country = "-"
if os.path.exists(os.pat... | 30.265625 | 116 | 0.661848 | import os
import base64
from django.conf import settings
from django.contrib.gis.geoip2 import GeoIP2
from geoip2.errors import AddressNotFoundError
from pyotp import TOTP
from KlimaKar.email import mail_managers, get_email_message
def report_user_login(user_session):
country = "-"
if os.path.exists(os.pat... | true | true |
f771a33107f1eeabd7387cd7e914b687486cd6c1 | 8,674 | py | Python | Nivek maths/kanu/element.py | ThiccTT/nivek-maths | 37f222b3ddc72455313eb619a79bc6045b89b506 | [
"MIT"
] | 6 | 2020-10-18T08:15:44.000Z | 2022-01-19T16:14:40.000Z | Nivek maths/kanu/element.py | ThiccTT/nivek-maths | 37f222b3ddc72455313eb619a79bc6045b89b506 | [
"MIT"
] | null | null | null | Nivek maths/kanu/element.py | ThiccTT/nivek-maths | 37f222b3ddc72455313eb619a79bc6045b89b506 | [
"MIT"
] | 3 | 2019-06-17T15:44:58.000Z | 2021-08-04T01:37:25.000Z | def get_matching_paren(exp: str) -> int:
""" Returns the index of the right parenthesis which matches the first left parenthesis.
exp[0] should be a left parenthesis
"""
if exp[0] != '(':
raise ValueError('Given string must begin with \'(\' character')
left = 1
right = 0
i = 1
... | 36.445378 | 119 | 0.521443 | def get_matching_paren(exp: str) -> int:
if exp[0] != '(':
raise ValueError('Given string must begin with \'(\' character')
left = 1
right = 0
i = 1
while left > right:
if exp[i] == '(':
left += 1
elif exp[i] == ')':
right += 1
i += 1
retur... | true | true |
f771a37b99f068381a666e22951522788114514f | 22,127 | py | Python | test/functional/test_framework/util.py | audunolsen/audunCoin | 4daa060194c1acdfacc2c047a8f3f2b4b3bb5fcf | [
"MIT"
] | 2 | 2019-03-21T15:17:41.000Z | 2019-03-21T15:17:43.000Z | test/functional/test_framework/util.py | audunolsen/audunCoin | 4daa060194c1acdfacc2c047a8f3f2b4b3bb5fcf | [
"MIT"
] | null | null | null | test/functional/test_framework/util.py | audunolsen/audunCoin | 4daa060194c1acdfacc2c047a8f3f2b4b3bb5fcf | [
"MIT"
] | 1 | 2020-11-24T10:23:28.000Z | 2020-11-24T10:23:28.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import unhexlif... | 38.887522 | 140 | 0.652416 |
from base64 import b64encode
from binascii import unhexlify
from decimal import Decimal, ROUND_DOWN
import hashlib
import inspect
import json
import logging
import os
import random
import re
from subprocess import CalledProcessError
import time
from . import coverage
from .authproxy import AuthServiceProxy, JSONRPCEx... | true | true |
f771a4349cfcc777cb180ad55d76782105bda2a4 | 653 | py | Python | videos/video_read.py | lillin-bug/Vehicle-Detection | 4fe7a376788033e67ffec5a0ab584a6b44c0c000 | [
"Apache-2.0"
] | null | null | null | videos/video_read.py | lillin-bug/Vehicle-Detection | 4fe7a376788033e67ffec5a0ab584a6b44c0c000 | [
"Apache-2.0"
] | null | null | null | videos/video_read.py | lillin-bug/Vehicle-Detection | 4fe7a376788033e67ffec5a0ab584a6b44c0c000 | [
"Apache-2.0"
] | null | null | null |
import os
import time
import cv2
import numpy as np
import matplotlib.pyplot as plt
def video_read(file_path):
if(os.path.exists(file_path)):
cv2_video = cv2.VideoCapture(file_path)
else:
cv2_video = cv2.VideoCapture(0)
i=0
print(cv2_video.isOpened())
# 获得码率及尺寸
while True:
... | 22.517241 | 83 | 0.62634 |
import os
import time
import cv2
import numpy as np
import matplotlib.pyplot as plt
def video_read(file_path):
if(os.path.exists(file_path)):
cv2_video = cv2.VideoCapture(file_path)
else:
cv2_video = cv2.VideoCapture(0)
i=0
print(cv2_video.isOpened())
while True:
res, ... | true | true |
f771a547c1ac05fe1abe5991663885f9fcd75ba4 | 1,540 | py | Python | aliyun-python-sdk-cloudwf/aliyunsdkcloudwf/request/v20170328/ShopCreatemarketingRequest.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-cloudwf/aliyunsdkcloudwf/request/v20170328/ShopCreatemarketingRequest.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-cloudwf/aliyunsdkcloudwf/request/v20170328/ShopCreatemarketingRequest.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... | 32.083333 | 86 | 0.745455 |
from aliyunsdkcore.request import RpcRequest
class ShopCreatemarketingRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'cloudwf', '2017-03-28', 'ShopCreatemarketing','cloudwf')
def get_Etime(self):
return self.get_query_params().get('Etime')
def set_Etime(self,Etime):
self.add_query... | true | true |
f771a5ee825b26aa44c81a559403712b4758df93 | 964 | py | Python | check.py | Open-Speech-EkStep/speech_music_classification | 0e394ec0f0d0ac7a177171f7ac7c254b1db38c2a | [
"MIT"
] | null | null | null | check.py | Open-Speech-EkStep/speech_music_classification | 0e394ec0f0d0ac7a177171f7ac7c254b1db38c2a | [
"MIT"
] | null | null | null | check.py | Open-Speech-EkStep/speech_music_classification | 0e394ec0f0d0ac7a177171f7ac7c254b1db38c2a | [
"MIT"
] | 1 | 2021-04-12T05:31:42.000Z | 2021-04-12T05:31:42.000Z | import torch
from torch.utils.data import DataLoader
from configs.train_config import SpectConfig
from loader.data_loader import SpectrogramDataset, collate_fn
from models.model import Conformer, get_conv_output_sizes
if __name__ == "__main__":
spect_cfg = SpectConfig()
songs_dset = SpectrogramDataset('/home/... | 31.096774 | 82 | 0.705394 | import torch
from torch.utils.data import DataLoader
from configs.train_config import SpectConfig
from loader.data_loader import SpectrogramDataset, collate_fn
from models.model import Conformer, get_conv_output_sizes
if __name__ == "__main__":
spect_cfg = SpectConfig()
songs_dset = SpectrogramDataset('/home/... | true | true |
f771a62c00d458546fd503745823318afbebc103 | 1,909 | py | Python | azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/check_name_availability_result.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/check_name_availability_result.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/models/check_name_availability_result.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 37.431373 | 76 | 0.629125 |
from msrest.serialization import Model
class CheckNameAvailabilityResult(Model):
_validation = {
'name_available': {'readonly': True},
'reason': {'readonly': True},
'message': {'readonly': True},
}
_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bo... | true | true |
f771a783cba5e08de88cab3b41bb1b5ed5b32904 | 1,961 | py | Python | python/nvstrings/tests/test_combine.py | williamBlazing/cudf | 072785e24fd59b6f4eeaad3b54592a8c803ee96b | [
"Apache-2.0"
] | 2 | 2019-12-25T14:20:17.000Z | 2019-12-25T14:33:02.000Z | python/nvstrings/tests/test_combine.py | CZZLEGEND/cudf | 5d2465d6738d00628673fffdc1fac51fad7ef9a7 | [
"Apache-2.0"
] | 17 | 2018-11-14T20:57:01.000Z | 2019-02-19T22:42:23.000Z | python/nvstrings/tests/test_combine.py | CZZLEGEND/cudf | 5d2465d6738d00628673fffdc1fac51fad7ef9a7 | [
"Apache-2.0"
] | 1 | 2021-10-03T20:29:10.000Z | 2021-10-03T20:29:10.000Z | # Copyright (c) 2018-2019, NVIDIA CORPORATION.
from utils import assert_eq
import nvstrings
def test_cat():
strs = nvstrings.to_device(
["abc", "def", None, "", "jkl", "mno", "accént"]
)
got = strs.cat()
expected = ["abcdefjklmnoaccént"]
assert_eq(got, expected)
# non-default separa... | 28.014286 | 78 | 0.54462 |
from utils import assert_eq
import nvstrings
def test_cat():
strs = nvstrings.to_device(
["abc", "def", None, "", "jkl", "mno", "accént"]
)
got = strs.cat()
expected = ["abcdefjklmnoaccént"]
assert_eq(got, expected)
got = strs.cat(sep=":")
expected = ["abc:def::jkl:mno:accén... | true | true |
f771a793bf9f3c8789e0db9541d6233dbdc2bf36 | 19,930 | py | Python | src/olympia/versions/tests/test_views.py | Patil2099/addons-server | b1684182a8e0e3d8dfbc1f5b64946580f20de933 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/versions/tests/test_views.py | Patil2099/addons-server | b1684182a8e0e3d8dfbc1f5b64946580f20de933 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/versions/tests/test_views.py | Patil2099/addons-server | b1684182a8e0e3d8dfbc1f5b64946580f20de933 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import six
from django.conf import settings
from django.utils.encoding import smart_text
from django.core.files import temp
from django.core.files.base import File as DjangoFile
from django.test.utils import override_settings
from django.utils.http import urlquote
from unittest impor... | 42.67666 | 79 | 0.672704 | import os
import six
from django.conf import settings
from django.utils.encoding import smart_text
from django.core.files import temp
from django.core.files.base import File as DjangoFile
from django.test.utils import override_settings
from django.utils.http import urlquote
from unittest import mock
from pyquery imp... | true | true |
f771a7c55b29fa1e27927e05b1c05e1871512255 | 289 | py | Python | examples/company_name_to_domain.py | pavelhouzva/ritetag-api-python | e4f1555d393506fec052bc5eb7ad757645adb345 | [
"Apache-2.0"
] | 1 | 2022-03-09T09:12:56.000Z | 2022-03-09T09:12:56.000Z | examples/company_name_to_domain.py | pavelhouzva/ritetag-api-python | e4f1555d393506fec052bc5eb7ad757645adb345 | [
"Apache-2.0"
] | null | null | null | examples/company_name_to_domain.py | pavelhouzva/ritetag-api-python | e4f1555d393506fec052bc5eb7ad757645adb345 | [
"Apache-2.0"
] | 2 | 2020-05-18T20:30:42.000Z | 2021-11-11T19:30:04.000Z | #!/usr/bin/env python
from ritetag import RiteTagApi, read_env_file, get_env
read_env_file('.env')
access_token = get_env('ACCESS_TOKEN')
client = RiteTagApi(access_token)
result = client.company_name_to_domain('Google')
def log(message):
print(message)
[log(r) for r in result]
| 18.0625 | 54 | 0.754325 | from ritetag import RiteTagApi, read_env_file, get_env
read_env_file('.env')
access_token = get_env('ACCESS_TOKEN')
client = RiteTagApi(access_token)
result = client.company_name_to_domain('Google')
def log(message):
print(message)
[log(r) for r in result]
| true | true |
f771a7d6aba69b0eb838a8b63f6da50d48c0eaf0 | 4,709 | py | Python | Code/odooerp/odoo-8.0/openerp/addons/base/ir/ir_config_parameter.py | zhupangithub/WEBERP | 714512082ec5c6db07cbf6af0238ceefe2d2c1a5 | [
"MIT"
] | null | null | null | Code/odooerp/odoo-8.0/openerp/addons/base/ir/ir_config_parameter.py | zhupangithub/WEBERP | 714512082ec5c6db07cbf6af0238ceefe2d2c1a5 | [
"MIT"
] | null | null | null | Code/odooerp/odoo-8.0/openerp/addons/base/ir/ir_config_parameter.py | zhupangithub/WEBERP | 714512082ec5c6db07cbf6af0238ceefe2d2c1a5 | [
"MIT"
] | 3 | 2020-10-08T14:42:10.000Z | 2022-01-28T14:12:29.000Z | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | 37.975806 | 129 | 0.613294 |
import uuid
import datetime
import logging
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools import misc, config, mute_logger
_logger = logging.getLogger(__name__)
_default_parameters = {
"database.uuid": lambda: (str(uuid.uuid1()), []),
"database.create_date": lambda: ... | true | true |
f771a877810165dab0acba7da511c064ddd22c21 | 759 | py | Python | users/migrations/0001_initial.py | MahmudulHassan5809/DjangoFullFeaturedBlogApp | 47a391edec66e8378af47edacda8cca124679dd0 | [
"MIT"
] | 1 | 2019-01-17T09:51:12.000Z | 2019-01-17T09:51:12.000Z | users/migrations/0001_initial.py | MahmudulHassan5809/DjangoFullFeaturedBlogApp | 47a391edec66e8378af47edacda8cca124679dd0 | [
"MIT"
] | 6 | 2020-02-11T23:37:49.000Z | 2022-03-11T23:38:54.000Z | users/migrations/0001_initial.py | MahmudulHassan5809/DjangoFullFeaturedBlogApp | 47a391edec66e8378af47edacda8cca124679dd0 | [
"MIT"
] | 1 | 2021-01-09T06:03:11.000Z | 2021-01-09T06:03:11.000Z | # Generated by Django 2.1.4 on 2019-01-03 18:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 29.192308 | 121 | 0.636364 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f771a8c1547fd3b4078a4ceb7ee1d6353317b181 | 462 | py | Python | farms2face/userregistration/migrations/0002_auto_20170404_1844.py | dev1farms2face/f2f | 54e58187a68574bf2bd0dfb7e58a2b416336106a | [
"MIT"
] | null | null | null | farms2face/userregistration/migrations/0002_auto_20170404_1844.py | dev1farms2face/f2f | 54e58187a68574bf2bd0dfb7e58a2b416336106a | [
"MIT"
] | null | null | null | farms2face/userregistration/migrations/0002_auto_20170404_1844.py | dev1farms2face/f2f | 54e58187a68574bf2bd0dfb7e58a2b416336106a | [
"MIT"
] | 2 | 2018-06-19T12:12:08.000Z | 2018-06-25T18:45:36.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-05 01:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userregistration', '0001_initial'),
]
operations = [
migrations.AlterField(... | 22 | 58 | 0.619048 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userregistration', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='birth_date',
... | true | true |
f771a93c5b1b9c62afa65cbcc1da165b2e4008ae | 5,774 | py | Python | models/model_keras_params.py | buzem/inzpeech | 9e03b876bb3fd1956774c84683cd02661d650c81 | [
"MIT"
] | 2 | 2020-11-14T18:25:00.000Z | 2020-11-16T07:53:39.000Z | models/model_keras_params.py | emreeyukseel/inzpeech | 9e03b876bb3fd1956774c84683cd02661d650c81 | [
"MIT"
] | null | null | null | models/model_keras_params.py | emreeyukseel/inzpeech | 9e03b876bb3fd1956774c84683cd02661d650c81 | [
"MIT"
] | 2 | 2020-11-14T10:36:40.000Z | 2020-11-14T16:27:33.000Z | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Dense, Input
from tensorflow.keras.layers import Dropout, GlobalMaxPooling2D
from tensorflow.keras.layers import Flatten, Conv2D, MaxPooling2D, ZeroPadding... | 36.314465 | 127 | 0.612747 | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Dense, Input
from tensorflow.keras.layers import Dropout, GlobalMaxPooling2D
from tensorflow.keras.layers import Flatten, Conv2D, MaxPooling2D, ZeroPadding... | true | true |
f771a9682761c0afcf31dd2fa93eb8d9ca2f629a | 3,676 | py | Python | processors_parser/middlewares.py | fiftin/intel_processors_parser | b53fed45e6961a4774d36be6985f553252079fcf | [
"MIT"
] | 1 | 2022-02-16T10:31:03.000Z | 2022-02-16T10:31:03.000Z | processors_parser/middlewares.py | fiftin/intel_processors_parser | b53fed45e6961a4774d36be6985f553252079fcf | [
"MIT"
] | null | null | null | processors_parser/middlewares.py | fiftin/intel_processors_parser | b53fed45e6961a4774d36be6985f553252079fcf | [
"MIT"
] | null | null | null | # Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# useful for handling different item types with a single interface
from itemadapter import is_item, ItemAdapter
class IntelProcessorsParserSpider... | 35.346154 | 78 | 0.676823 |
from scrapy import signals
from itemadapter import is_item, ItemAdapter
class IntelProcessorsParserSpiderMiddleware:
@classmethod
def from_crawler(cls, crawler):
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def pr... | true | true |
f771a9ccf1591684e2cdb44cc372565eb050fe8e | 12,440 | py | Python | pratt.py | DasIch/pratt | 2ca220d0baefc11b12989b7b8b9437f6c32c37fc | [
"BSD-3-Clause"
] | 7 | 2017-04-13T02:43:57.000Z | 2021-11-08T11:44:17.000Z | pratt.py | DasIch/pratt | 2ca220d0baefc11b12989b7b8b9437f6c32c37fc | [
"BSD-3-Clause"
] | 1 | 2015-04-20T09:21:54.000Z | 2015-04-20T09:21:54.000Z | pratt.py | DasIch/pratt | 2ca220d0baefc11b12989b7b8b9437f6c32c37fc | [
"BSD-3-Clause"
] | 2 | 2016-06-06T21:12:33.000Z | 2020-07-23T08:04:20.000Z | # encoding: utf-8
"""
pratt
~~~~~
:copyright: 2015 by Daniel Neuhäuser
:license: BSD, see LICENSE.rst for details
"""
#: The library version as a string.
__version__ = '0.2.0'
#: The library version as a tuple ``(major, minor, patch)``.
__version_info__ = (0, 2, 0)
class PrattException(Exception):... | 35.644699 | 85 | 0.62299 |
__version__ = '0.2.0'
__version_info__ = (0, 2, 0)
class PrattException(Exception):
class UnexpectedToken(PrattException):
def __init__(self, token):
super(UnexpectedToken, self).__init__(token)
self.token = token
def handle_unexpected_token(token):
raise UnexpectedToken(token)
... | true | true |
f771a9d8b8dcf9ee77866e3f45c2791ebb4dfc9c | 851 | py | Python | solytics/urls.py | khanjanshah/Django-app-api | 963bd8198efb76924d96312e8482629b588f1e69 | [
"MIT"
] | null | null | null | solytics/urls.py | khanjanshah/Django-app-api | 963bd8198efb76924d96312e8482629b588f1e69 | [
"MIT"
] | null | null | null | solytics/urls.py | khanjanshah/Django-app-api | 963bd8198efb76924d96312e8482629b588f1e69 | [
"MIT"
] | null | null | null | """solytics URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 35.458333 | 77 | 0.696827 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/user/', include('user.urls')),
path('api/model/', include('model.urls')),
]
| true | true |
f771abd8d6508d5aaa82c01d70ee8d81d224cb9c | 2,539 | py | Python | samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-ip-rsvp-cfg/nc-delete-xr-ip-rsvp-cfg-20-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | 104 | 2016-03-15T17:04:01.000Z | 2021-12-31T06:09:35.000Z | samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-ip-rsvp-cfg/nc-delete-xr-ip-rsvp-cfg-20-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 15 | 2016-03-15T23:09:47.000Z | 2020-08-13T12:13:18.000Z | samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-ip-rsvp-cfg/nc-delete-xr-ip-rsvp-cfg-20-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 87 | 2016-04-15T16:59:23.000Z | 2021-09-18T18:05:47.000Z | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, 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 applicab... | 33.407895 | 78 | 0.653407 |
from argparse import ArgumentParser
from urlparse import urlparse
from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_ip_rsvp_cfg \
as xr_ip_rsvp_cfg
import logging
if __name__ == "__main__":
parser = ArgumentParser()
pa... | true | true |
f771ad0edc303b8dbfd08556027337f62e71bc4d | 11,066 | py | Python | plotly_study/graph_objs/table/hoverlabel/__init__.py | lucasiscovici/plotly_py | 42ab769febb45fbbe0a3c677dc4306a4f59cea36 | [
"MIT"
] | null | null | null | plotly_study/graph_objs/table/hoverlabel/__init__.py | lucasiscovici/plotly_py | 42ab769febb45fbbe0a3c677dc4306a4f59cea36 | [
"MIT"
] | null | null | null | plotly_study/graph_objs/table/hoverlabel/__init__.py | lucasiscovici/plotly_py | 42ab769febb45fbbe0a3c677dc4306a4f59cea36 | [
"MIT"
] | null | null | null | from plotly_study.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# color
# -----
@property
def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#f... | 34.260062 | 88 | 0.565606 | from plotly_study.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
@property
def color(self):
return self["color"]
@color.setter
def color(self, val):
self["color"] = val
@property
... | true | true |
f771adbafbe8401e0228d515dcf56f5ebec3ba88 | 5,742 | py | Python | django/contrib/flatpages/tests/test_templatetags.py | arachnegl/django | c4e796aa1bab70ee66151d24a061af811e08ad08 | [
"BSD-3-Clause"
] | 1 | 2019-01-14T10:58:43.000Z | 2019-01-14T10:58:43.000Z | django/contrib/flatpages/tests/test_templatetags.py | arachnegl/django | c4e796aa1bab70ee66151d24a061af811e08ad08 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/flatpages/tests/test_templatetags.py | arachnegl/django | c4e796aa1bab70ee66151d24a061af811e08ad08 | [
"BSD-3-Clause"
] | 1 | 2020-05-25T08:55:19.000Z | 2020-05-25T08:55:19.000Z | from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase, override_settings
from .settings import FLATPAGES_TEMPLATES
@override_settings(
MIDDLEWARE_C... | 42.850746 | 102 | 0.605712 | from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase, override_settings
from .settings import FLATPAGES_TEMPLATES
@override_settings(
MIDDLEWARE_C... | true | true |
f771ade81eed63205907527373fb20c8d29bf7f6 | 7,546 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20160601/get_virtual_network.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20160601/get_virtual_network.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20160601/get_virtual_network.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 37.919598 | 215 | 0.65982 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetVirtualNetworkResult',
'AwaitableGetVirtualNetworkResult',
'get_virtual_network',
]
@pulumi.output_type
class GetVirtual... | true | true |
f771ae57629c42acc14f7db502c6629b3ba8e141 | 13,501 | py | Python | keylime/ima_ast.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/ima_ast.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/ima_ast.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2021 Thore Sommer
AST with parser and validator for IMA ASCII entries.
Implements the templates (modes) and types as defined in:
- https://elixir.bootlin.com/linux/latest/source/security/integrity/ima/ima_template.c
- https://www.kernel.org/doc/html/v5.12/security/IMA-... | 35.342932 | 137 | 0.601659 |
import binascii
import codecs
import struct
import abc
import typing
from typing import Dict, Callable, Optional, Union
from keylime import config
from keylime import keylime_logging
from keylime.common.algorithms import Hash
from keylime.failure import Failure, Component
logger = keylime_logging.init_logging("ima")... | true | true |
f771ae5f27333d77fdd757545baabc6ef87d198a | 281 | py | Python | server.py | Jacob-Lewis/Autobots | bcc646bec3fe759def6ffcf1583e6606344a88e2 | [
"MIT"
] | 1 | 2021-07-07T16:28:35.000Z | 2021-07-07T16:28:35.000Z | server.py | Jacob-Lewis/Autobots | bcc646bec3fe759def6ffcf1583e6606344a88e2 | [
"MIT"
] | null | null | null | server.py | Jacob-Lewis/Autobots | bcc646bec3fe759def6ffcf1583e6606344a88e2 | [
"MIT"
] | null | null | null | from flask import Flask
from threading import Thread
app = Flask(__name__)
@app.route("/")
def hello():
return '<h2>hello</h2>'
def run():
#app.run(host='127.0.0.1',port=5000)
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
| 16.529412 | 38 | 0.637011 | from flask import Flask
from threading import Thread
app = Flask(__name__)
@app.route("/")
def hello():
return '<h2>hello</h2>'
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
| true | true |
f771af2254e6fcc180b3a09ed1ae3587f1f767fa | 159 | py | Python | Submissions/Easy/00069_Sqrt_X.py | abhisekjuneja/LeetCode | bfcdefe81b34e0de969b96c694cc74c9e241f15f | [
"MIT"
] | null | null | null | Submissions/Easy/00069_Sqrt_X.py | abhisekjuneja/LeetCode | bfcdefe81b34e0de969b96c694cc74c9e241f15f | [
"MIT"
] | null | null | null | Submissions/Easy/00069_Sqrt_X.py | abhisekjuneja/LeetCode | bfcdefe81b34e0de969b96c694cc74c9e241f15f | [
"MIT"
] | null | null | null | # Difficulty: Easy
# Problem Statement: https://leetcode.com/problems/sqrtx/
class Solution:
def mySqrt(self, x: int) -> int:
return int(x ** 0.5) | 26.5 | 57 | 0.654088 |
class Solution:
def mySqrt(self, x: int) -> int:
return int(x ** 0.5) | true | true |
f771af5a46e739b1b77b9ab9ab39ac216ce168a8 | 607 | py | Python | qcloudsdkbgpip/BgpipQueryResourcesRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkbgpip/BgpipQueryResourcesRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkbgpip/BgpipQueryResourcesRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class BgpipQueryResourcesRequest(Request):
def __init__(self):
super(BgpipQueryResourcesRequest, self).__init__(
'bgpip', 'qcloudcliV1', 'BgpipQueryResources', 'bgpip.api.qcloud.com')
def get_region(self):
return s... | 27.590909 | 82 | 0.680395 |
from qcloudsdkcore.request import Request
class BgpipQueryResourcesRequest(Request):
def __init__(self):
super(BgpipQueryResourcesRequest, self).__init__(
'bgpip', 'qcloudcliV1', 'BgpipQueryResources', 'bgpip.api.qcloud.com')
def get_region(self):
return self.get_params().get('re... | true | true |
f771af99a40d9c39263ba431573231a4b61b183c | 1,153 | py | Python | samples/snippets/prediction_service/predict_image_classification_sample_test.py | dizcology/python-aiplatform | 1a135775966c8a2303ded529eba514dcf9db7205 | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | samples/snippets/predict_image_classification_sample_test.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | samples/snippets/predict_image_classification_sample_test.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.942857 | 78 | 0.786644 |
import os
import pathlib
import predict_image_classification_sample
ENDPOINT_ID = "71213169107795968" PROJECT_ID = os.getenv("BUILD_SPECIFIC_GCLOUD_PROJECT")
PATH_TO_IMG = pathlib.Path(__file__).parent.absolute() / "resources/daisy.jpg"
def test_ucaip_generated_predict_image_classification_sample(capsys):
... | true | true |
f771b1167d43cd914374ca0a687948e9093bd56a | 2,578 | py | Python | experiments/train_v1.py | latticetower/dr-derks-mutants | 5c3ab86137ecb478a3013985172d160568a86b13 | [
"MIT"
] | 1 | 2021-02-02T14:19:51.000Z | 2021-02-02T14:19:51.000Z | experiments/train_v1.py | latticetower/dr-derks-mutants | 5c3ab86137ecb478a3013985172d160568a86b13 | [
"MIT"
] | null | null | null | experiments/train_v1.py | latticetower/dr-derks-mutants | 5c3ab86137ecb478a3013985172d160568a86b13 | [
"MIT"
] | 1 | 2021-04-08T15:47:25.000Z | 2021-04-08T15:47:25.000Z | """Basic 'network'.
This code is based on example
http://docs.gym.derkgame.com/#neural-network-example
"""
import gym
from gym_derk.envs import DerkEnv
from gym_derk import ObservationKeys
import math
import numpy as np
import os.path
from models.network_v1 import Network
SEED = 137
np.random.seed(SEED)
NPZ_FILENAM... | 25.27451 | 75 | 0.608999 | import gym
from gym_derk.envs import DerkEnv
from gym_derk import ObservationKeys
import math
import numpy as np
import os.path
from models.network_v1 import Network
SEED = 137
np.random.seed(SEED)
NPZ_FILENAME = "weights/model_v2.npz"
REWARD_FUNCTION = {
"damageEnemyStatue": 4,
"damageEnemyUnit": 2,
"ki... | true | true |
f771b170cb1bdf6b9f46fa6efe17daf7f76e2024 | 5,417 | py | Python | pyservices/store/crud.py | makkalot/eskit-example-microservice | 5873ee27d1486ebb4617bf3026c2d983ff300a05 | [
"BSD-2-Clause"
] | null | null | null | pyservices/store/crud.py | makkalot/eskit-example-microservice | 5873ee27d1486ebb4617bf3026c2d983ff300a05 | [
"BSD-2-Clause"
] | null | null | null | pyservices/store/crud.py | makkalot/eskit-example-microservice | 5873ee27d1486ebb4617bf3026c2d983ff300a05 | [
"BSD-2-Clause"
] | null | null | null | from copy import deepcopy
import datetime
import jsonpatch
import json
from common import originator_pb2 as common
import pyservices.generated.eventstore.service_pb2 as es
import pyservices.generated.eventstore.event_pb2 as esdata
import pyservices.generated.eventstore.service_pb2_grpc as esgrpc
class NotFoundError(... | 36.113333 | 118 | 0.638545 | from copy import deepcopy
import datetime
import jsonpatch
import json
from common import originator_pb2 as common
import pyservices.generated.eventstore.service_pb2 as es
import pyservices.generated.eventstore.event_pb2 as esdata
import pyservices.generated.eventstore.service_pb2_grpc as esgrpc
class NotFoundError(... | true | true |
f771b1973c6f400814f48061a2e2f404e4850b92 | 1,495 | py | Python | core/clients/python/api_bindings/cb2_api/objects/group.py | aledbf/digitalrebar | 417a40ea5ace35160f2aeb76f4153d5b70305ce4 | [
"Apache-2.0"
] | 103 | 2016-09-29T17:29:40.000Z | 2022-03-13T23:16:08.000Z | core/clients/python/api_bindings/cb2_api/objects/group.py | aledbf/digitalrebar | 417a40ea5ace35160f2aeb76f4153d5b70305ce4 | [
"Apache-2.0"
] | 48 | 2016-09-15T22:19:59.000Z | 2018-03-06T14:06:20.000Z | core/clients/python/api_bindings/cb2_api/objects/group.py | aledbf/digitalrebar | 417a40ea5ace35160f2aeb76f4153d5b70305ce4 | [
"Apache-2.0"
] | 25 | 2016-09-14T18:43:26.000Z | 2020-07-25T20:01:56.000Z | # Copyright 2014, Dell
#
# 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, so... | 27.181818 | 79 | 0.621405 |
from cb2_api.endpoint import EndPoint
from apiobject import ApiObject
class GroupEP(EndPoint):
__endpoint = "/api/v2/groups"
__apiObjectType = "Group"
def __init__(self, session):
self.session = session
self.endpoint = GroupEP.__endpoint
super(GroupEP, s... | true | true |
f771b1a75511ed122e1175ccf4e071696c38bf29 | 6,637 | py | Python | codes/nlper/models/text_clf.py | TingFree/AI_Conference_Timeline | 788dd5a4a8cd5009d8de3a1306ddb38f044cc7c5 | [
"MIT"
] | 2 | 2021-02-03T03:48:48.000Z | 2021-03-06T01:46:25.000Z | codes/nlper/models/text_clf.py | TingFree/AI_Conference_Timeline | 788dd5a4a8cd5009d8de3a1306ddb38f044cc7c5 | [
"MIT"
] | null | null | null | codes/nlper/models/text_clf.py | TingFree/AI_Conference_Timeline | 788dd5a4a8cd5009d8de3a1306ddb38f044cc7c5 | [
"MIT"
] | null | null | null | r"""
各种文本分类模型的实现
"""
import os
import torch
import torch.nn.functional as F
from torch import nn
from torch.optim import AdamW
from torch.utils.data import DataLoader
from transformers import AutoModel
from transformers.models.bert.modeling_bert import BertModel
from transformers import DataCollatorWithPadding, get_li... | 42.544872 | 124 | 0.602983 |
import os
import torch
import torch.nn.functional as F
from torch import nn
from torch.optim import AdamW
from torch.utils.data import DataLoader
from transformers import AutoModel
from transformers.models.bert.modeling_bert import BertModel
from transformers import DataCollatorWithPadding, get_linear_schedule_with_wa... | true | true |
f771b1aa05d5bea84359e5dbd7a334455f4979c8 | 1,403 | py | Python | garage/replay_buffer/simple_replay_buffer.py | shadiakiki1986/garage | 095bb5d25b32df1d44b47e99a78a9b01796941d9 | [
"MIT"
] | 3 | 2019-08-11T22:26:55.000Z | 2020-11-28T10:23:50.000Z | garage/replay_buffer/simple_replay_buffer.py | shadiakiki1986/garage | 095bb5d25b32df1d44b47e99a78a9b01796941d9 | [
"MIT"
] | null | null | null | garage/replay_buffer/simple_replay_buffer.py | shadiakiki1986/garage | 095bb5d25b32df1d44b47e99a78a9b01796941d9 | [
"MIT"
] | 2 | 2019-08-11T22:30:14.000Z | 2021-03-25T02:57:50.000Z | """This module implements a simple replay buffer."""
import numpy as np
from garage.misc.overrides import overrides
from garage.replay_buffer.base import ReplayBuffer
class SimpleReplayBuffer(ReplayBuffer):
"""
This class implements SimpleReplayBuffer.
It uses random batch sample to minimize correlation... | 34.219512 | 78 | 0.668567 | import numpy as np
from garage.misc.overrides import overrides
from garage.replay_buffer.base import ReplayBuffer
class SimpleReplayBuffer(ReplayBuffer):
def __init__(self, **kwargs):
super(SimpleReplayBuffer, self).__init__(**kwargs)
@overrides
def sample(self, batch_size):
assert self... | true | true |
f771b356dfb832d9291195879d09fcabd5755261 | 13,111 | py | Python | sdk/python/pulumi_aws/xray/sampling_rule.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/xray/sampling_rule.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/xray/sampling_rule.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import ... | 44.144781 | 251 | 0.628861 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
__all__ = ['SamplingRule']
class SamplingRule(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Opti... | true | true |
f771b3dbbfd4b087a287dcd4e051b8fb519b97b9 | 3,011 | py | Python | python/ansible/plugins/action/adcm_hc.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | python/ansible/plugins/action/adcm_hc.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | python/ansible/plugins/action/adcm_hc.py | dimuha-rs/adcm | 0f49cc9ece16c1e257be12375a64b65a34b3a3ae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 31.694737 | 96 | 0.670541 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1', 'supported_by': 'Arenadata'}
DOCUMENTATION = r'''
---
module: adcm_hc
short_description: change host component map (hc) for cluster
description:
- The C(adcm_hc) module is intende... | true | true |
f771b5414f687442bcfd8fcd297af75204fa88da | 2,452 | py | Python | app.py | sammylev/ToDoApp | 57f24191c020ae7785c2dced569dfa4fb9605cab | [
"MIT"
] | null | null | null | app.py | sammylev/ToDoApp | 57f24191c020ae7785c2dced569dfa4fb9605cab | [
"MIT"
] | null | null | null | app.py | sammylev/ToDoApp | 57f24191c020ae7785c2dced569dfa4fb9605cab | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect, url_for, jsonify, abort
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import sys
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://sammymurray@localhost:5432/todoapp'
db = SQLAlchemy(app)
migrate = Migrate(... | 28.183908 | 87 | 0.70106 | from flask import Flask, render_template, request, redirect, url_for, jsonify, abort
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import sys
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://sammymurray@localhost:5432/todoapp'
db = SQLAlchemy(app)
migrate = Migrate(... | true | true |
f771b57172ac1c426f7ef447b6901f3df642d372 | 6,167 | py | Python | deeplearning/ml4pl/testing/random_log_database_generator_test.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | null | null | null | deeplearning/ml4pl/testing/random_log_database_generator_test.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | 2 | 2020-07-27T08:22:06.000Z | 2020-07-30T17:34:35.000Z | deeplearning/ml4pl/testing/random_log_database_generator_test.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | 1 | 2020-06-05T04:58:13.000Z | 2020-06-05T04:58:13.000Z | # Copyright 2019 the ProGraML authors.
#
# Contact Chris Cummins <chrisc.101@gmail.com>.
#
# 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
#
# ... | 30.082927 | 80 | 0.758878 | import sqlalchemy as sql
from deeplearning.ml4pl import run_id as run_id_lib
from deeplearning.ml4pl.graphs.labelled import graph_tuple_database
from deeplearning.ml4pl.models import log_database
from deeplearning.ml4pl.testing import random_graph_tuple_database_generator
from deeplearning.ml4pl.testing import random_... | true | true |
f771b5e05a3b9f8d53bc2c154dad85b0e6865a79 | 17,147 | py | Python | huaweicloud-sdk-cloudbuild/huaweicloudsdkcloudbuild/v3/cloudbuild_client.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-cloudbuild/huaweicloudsdkcloudbuild/v3/cloudbuild_client.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-cloudbuild/huaweicloudsdkcloudbuild/v3/cloudbuild_client.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
from __future__ import absolute_import
import datetime
import re
import importlib
import six
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request imp... | 31.290146 | 113 | 0.630956 |
from __future__ import absolute_import
import datetime
import re
import importlib
import six
from huaweicloudsdkcore.client import Client, ClientBuilder
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcore.utils import http_utils
from huaweicloudsdkcore.sdk_stream_request import SdkStreamReq... | true | true |
f771b6180ace38b005de597476e3db0367acfb8f | 1,126 | py | Python | test/functional/sapling_wallet_persistence.py | nhoussay/groom | 87e69a80c1e15e4683ef64c55ac65547910b1c97 | [
"MIT"
] | null | null | null | test/functional/sapling_wallet_persistence.py | nhoussay/groom | 87e69a80c1e15e4683ef64c55ac65547910b1c97 | [
"MIT"
] | null | null | null | test/functional/sapling_wallet_persistence.py | nhoussay/groom | 87e69a80c1e15e4683ef64c55ac65547910b1c97 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 20202 The groom developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import groomTestFramework
from test_fra... | 37.533333 | 87 | 0.726465 |
from test_framework.test_framework import groomTestFramework
from test_framework.util import *
class SaplingWalletPersistenceTest(groomTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
def run_test(self):
sapling_addr = self.nodes[0].getnewsh... | true | true |
f771b6e2ab816117c94262f40e36800f9e5dbd8c | 2,285 | py | Python | plugins/hippocampe/icon_hippocampe/actions/hipposcore/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/hippocampe/icon_hippocampe/actions/hipposcore/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/hippocampe/icon_hippocampe/actions/hipposcore/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Return a score for each of the given observables. The score is ranged between 0 and -100 (0 = observable unknown, -100 = super evil observable)"
class Input:
OBSERVABLES = "observables"
class Output:
... | 20.401786 | 163 | 0.497155 | import komand
import json
class Component:
DESCRIPTION = "Return a score for each of the given observables. The score is ranged between 0 and -100 (0 = observable unknown, -100 = super evil observable)"
class Input:
OBSERVABLES = "observables"
class Output:
SCORES = "scores"
class Hipposcore... | true | true |
f771b751e0914f13b6f44b730ef3aa8fe30b6443 | 742 | py | Python | Informatik1/Actual Finals/Finals Solutions/4 Testing/testing.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 8 | 2021-11-21T10:02:08.000Z | 2022-03-15T21:02:02.000Z | Informatik1/Actual Finals/Finals Solutions/4 Testing/testing.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | null | null | null | Informatik1/Actual Finals/Finals Solutions/4 Testing/testing.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 3 | 2021-11-19T18:52:56.000Z | 2022-02-27T15:45:59.000Z | #!/usr/bin/env python3
import unittest
class MyTestSuite(unittest.TestCase):
def test_len_3(self):
self.assertTrue(is_palindrome("bob"))
def test_len_less_than_3_raises_ValueError(self):
with self.assertRaises(ValueError):
self.assertTrue(is_palindrome("aa"))
def test_basic(s... | 27.481481 | 53 | 0.690027 |
import unittest
class MyTestSuite(unittest.TestCase):
def test_len_3(self):
self.assertTrue(is_palindrome("bob"))
def test_len_less_than_3_raises_ValueError(self):
with self.assertRaises(ValueError):
self.assertTrue(is_palindrome("aa"))
def test_basic(self):
self.asse... | true | true |
f771b8891dadf68aa1a2e6eeb042367c0c9f3a77 | 6,253 | py | Python | videoanalyst/model/backbone/backbone_impl/snn3.py | Jee-King/STNet | 221ab60c4fccfce5a03e8878fb168e0baa7152f4 | [
"MIT"
] | 7 | 2022-03-28T15:08:21.000Z | 2022-03-31T02:59:39.000Z | videoanalyst/model/backbone/backbone_impl/snn3.py | Jee-King/STNet | 221ab60c4fccfce5a03e8878fb168e0baa7152f4 | [
"MIT"
] | null | null | null | videoanalyst/model/backbone/backbone_impl/snn3.py | Jee-King/STNet | 221ab60c4fccfce5a03e8878fb168e0baa7152f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
# --------------------------------------------------------
# SNNformer Feature Extractor (SFE) - SNN branch
# --------------------------------------------------------
import torch.nn as nn
import torch
from videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES,
... | 39.08125 | 110 | 0.588198 |
import torch.nn as nn
import torch
from videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES,
VOS_BACKBONES)
from videoanalyst.model.common_opr.common_block import conv_bn_relu
from videoanalyst.model.module_base import ModuleBase
thresh_bais = 0.3
... | true | true |
f771b9ae22246a57ced7be4f686169b16fe232e8 | 962 | py | Python | test_voc_SS.py | LeSoleil1/keras-yolo3 | c912b853457bc7b818d038099e611bad7fa18dfe | [
"MIT"
] | null | null | null | test_voc_SS.py | LeSoleil1/keras-yolo3 | c912b853457bc7b818d038099e611bad7fa18dfe | [
"MIT"
] | null | null | null | test_voc_SS.py | LeSoleil1/keras-yolo3 | c912b853457bc7b818d038099e611bad7fa18dfe | [
"MIT"
] | null | null | null | import argparse
import json
from voc import parse_voc_annotation
argparser = argparse.ArgumentParser(description='train and evaluate YOLO_v3 model on any dataset')
argparser.add_argument('-c', '--conf', help='path to configuration file')
args = argparser.parse_args()
config_path = args.conf
with open(config_path... | 38.48 | 193 | 0.724532 | import argparse
import json
from voc import parse_voc_annotation
argparser = argparse.ArgumentParser(description='train and evaluate YOLO_v3 model on any dataset')
argparser.add_argument('-c', '--conf', help='path to configuration file')
args = argparser.parse_args()
config_path = args.conf
with open(config_path... | true | true |
f771b9ef2600d67439c87a79f7a24f73ff61633c | 3,434 | py | Python | Tests/Plot/LamWind/test_Slot_12_plot.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | Tests/Plot/LamWind/test_Slot_12_plot.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | Tests/Plot/LamWind/test_Slot_12_plot.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
from os.path import join
import matplotlib.pyplot as plt
from numpy import array, pi, zeros
from pyleecan.Classes.Frame import Frame
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.LamSquirrelCage import LamSquirrelCage
from pyleecan.Classes.MachineDFIM import Machin... | 36.531915 | 86 | 0.653757 | from os.path import join
import matplotlib.pyplot as plt
from numpy import array, pi, zeros
from pyleecan.Classes.Frame import Frame
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.LamSquirrelCage import LamSquirrelCage
from pyleecan.Classes.MachineDFIM import MachineDFIM
from pyleecan.Clas... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.