hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7047aea295f4a46ad31eccfb2a0560c06204007 | 140 | py | Python | ctpbee/context/__init__.py | yutiansut/ctpbee | 02ceb3d4456a54b1b4f8066a2662c4b8fac1027f | [
"MIT"
] | 1 | 2019-10-31T06:45:44.000Z | 2019-10-31T06:45:44.000Z | ctpbee/context/__init__.py | dengwen168/ctpbee | 466d1f804784cf2c3e7f2ed5d28bbcf1068c9215 | [
"MIT"
] | null | null | null | ctpbee/context/__init__.py | dengwen168/ctpbee | 466d1f804784cf2c3e7f2ed5d28bbcf1068c9215 | [
"MIT"
] | 3 | 2019-11-21T03:38:14.000Z | 2022-02-14T08:09:11.000Z | from .proxy import current_app, _app_context_ctx, switch_app, get_app
__all__ = [
current_app, _app_context_ctx, switch_app, get_app
]
| 23.333333 | 69 | 0.785714 | from .proxy import current_app, _app_context_ctx, switch_app, get_app
__all__ = [
current_app, _app_context_ctx, switch_app, get_app
]
| true | true |
f7047b77b912b92a65cdfa5ae1beff0ef4bf1daf | 993 | py | Python | backends/utils.py | DaKnOb/TorPaste | fb74f645c778e9a0e5cf6f37d96a2c3d1eb631fe | [
"MIT"
] | 12 | 2016-09-28T20:48:50.000Z | 2021-06-26T21:00:38.000Z | backends/utils.py | daknob/TorPaste | fb74f645c778e9a0e5cf6f37d96a2c3d1eb631fe | [
"MIT"
] | 56 | 2016-09-25T19:30:49.000Z | 2017-10-28T22:32:57.000Z | backends/utils.py | daknob/TorPaste | fb74f645c778e9a0e5cf6f37d96a2c3d1eb631fe | [
"MIT"
] | 15 | 2016-09-25T17:57:25.000Z | 2019-12-02T14:56:27.000Z | from functools import wraps
from os import environ
from backends.exceptions import ErrorException
def wrap_exception(exception_type, error_message):
def _typed_exception_wrapper(func):
@wraps(func)
def _adapt_exception_types(*args, **kwargs):
try:
return func(*args, **... | 25.461538 | 61 | 0.640483 | from functools import wraps
from os import environ
from backends.exceptions import ErrorException
def wrap_exception(exception_type, error_message):
def _typed_exception_wrapper(func):
@wraps(func)
def _adapt_exception_types(*args, **kwargs):
try:
return func(*args, **... | true | true |
f7047bdc314b74d6a8044103b6f51f42f1a1c853 | 3,064 | py | Python | Project/TF_IDF/TF_IDF/TF_IDF_FULL.py | aksh4y/Information-Retrieval | 702ec6e6dce303a6ff8f1695e6380c10665ca888 | [
"MIT"
] | null | null | null | Project/TF_IDF/TF_IDF/TF_IDF_FULL.py | aksh4y/Information-Retrieval | 702ec6e6dce303a6ff8f1695e6380c10665ca888 | [
"MIT"
] | null | null | null | Project/TF_IDF/TF_IDF/TF_IDF_FULL.py | aksh4y/Information-Retrieval | 702ec6e6dce303a6ff8f1695e6380c10665ca888 | [
"MIT"
] | null | null | null |
# coding: utf-8
# ### All imports
# In[1]:
from tf_idf import *
from evaluation import *
# In[3]:
corpus_dict = loadCorpus("corpus")
print("corpus loaded")
# In[4]:
len(corpus_dict)
corpus_dict['CACM-0637']
# In[5]:
full_corpus_dict = loadCorpus("full_corpus")
print("full_corpus loaded")
# In[6]:
f... | 15.243781 | 122 | 0.674608 |
import *
corpus_dict = loadCorpus("corpus")
print("corpus loaded")
len(corpus_dict)
corpus_dict['CACM-0637']
full_corpus_dict = loadCorpus("full_corpus")
print("full_corpus loaded")
full_corpus_dict['CACM-0270']
unigrams_dict = generateUnigrams(corpus_dict)
print("Unigrams loaded")
len(unig... | true | true |
f7047c2b8bde539b9f3aba32ae810e49dccf2b66 | 8,667 | py | Python | qubit/utilities/gaussian.py | Xergon-sci/qubit | 3833e6fbb242572a370bfc1419b6f10d684e024b | [
"MIT"
] | null | null | null | qubit/utilities/gaussian.py | Xergon-sci/qubit | 3833e6fbb242572a370bfc1419b6f10d684e024b | [
"MIT"
] | 2 | 2020-11-20T14:05:59.000Z | 2020-11-20T18:35:42.000Z | qubit/utilities/gaussian.py | Xergon-sci/qubit | 3833e6fbb242572a370bfc1419b6f10d684e024b | [
"MIT"
] | null | null | null | import os
"""This submodule aims to provide utilities for the gaussian software package.
It will allow the user to quickly write custom interfaces to analyse the output files.
"""
class Extractor:
"""This class supports data extraction from gaussian output files.
It provides functionality to extract all the ... | 32.339552 | 114 | 0.508365 | import os
class Extractor:
def __init__(self, filepath, labels=None):
self.filepath = filepath
self.labels = labels
self.normal_executions = 0
self.check_normal_execution()
self.check_frequencies()
self.label_positions = self._get_label_positions()
... | true | true |
f7047c4cf0cecbec6882cc096843a0ec4ee2cc45 | 3,269 | py | Python | test/variational/test_unwhitened_variational_strategy.py | jrg365/gpytorch | 52bf07a3a3c55a570b22ff2bf3825adf4a6e259d | [
"MIT"
] | 188 | 2017-06-09T20:42:18.000Z | 2018-02-15T11:17:09.000Z | test/variational/test_unwhitened_variational_strategy.py | jrg365/gpytorch | 52bf07a3a3c55a570b22ff2bf3825adf4a6e259d | [
"MIT"
] | 49 | 2017-07-18T02:55:17.000Z | 2018-02-15T21:23:42.000Z | test/variational/test_unwhitened_variational_strategy.py | jrg365/gpytorch | 52bf07a3a3c55a570b22ff2bf3825adf4a6e259d | [
"MIT"
] | 24 | 2017-07-12T17:29:52.000Z | 2018-02-15T19:25:07.000Z | #!/usr/bin/env python3
import unittest
import torch
import gpytorch
from gpytorch.test.variational_test_case import VariationalTestCase
class TestUnwhitenedVariationalGP(VariationalTestCase, unittest.TestCase):
@property
def batch_shape(self):
return torch.Size([])
@property
def distributi... | 32.04902 | 111 | 0.755583 |
import unittest
import torch
import gpytorch
from gpytorch.test.variational_test_case import VariationalTestCase
class TestUnwhitenedVariationalGP(VariationalTestCase, unittest.TestCase):
@property
def batch_shape(self):
return torch.Size([])
@property
def distribution_cls(self):
... | true | true |
f7047c80bcef1eb93fe9deefa4df85a7d72cf061 | 2,893 | py | Python | xmlschema/testing/observers.py | jmuhlich/xmlschema | f5ee17fecaf46a4f88bbc46a2a2d08a9378681c1 | [
"MIT"
] | null | null | null | xmlschema/testing/observers.py | jmuhlich/xmlschema | f5ee17fecaf46a4f88bbc46a2a2d08a9378681c1 | [
"MIT"
] | null | null | null | xmlschema/testing/observers.py | jmuhlich/xmlschema | f5ee17fecaf46a4f88bbc46a2a2d08a9378681c1 | [
"MIT"
] | null | null | null | #
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | 34.440476 | 94 | 0.637401 |
from functools import wraps
from ..names import XSD_NAMESPACE, XSD_ANY_TYPE
from ..validators import XMLSchema10, XMLSchema11, XsdGroup, XsdAttributeGroup, XsdComplexType
class SchemaObserver:
components = []
dummy_components = []
@classmethod
def observed_builder(cls, builder):
if ... | true | true |
f7047cab0fffa71371bea1dc1d55464ee8b6212b | 569 | py | Python | tests/conftest.py | bjuergens/NaturalNets | fd67f1b3c443761270adaf9877ed2a6358d830f0 | [
"MIT"
] | null | null | null | tests/conftest.py | bjuergens/NaturalNets | fd67f1b3c443761270adaf9877ed2a6358d830f0 | [
"MIT"
] | 2 | 2021-04-13T11:47:01.000Z | 2021-04-30T11:44:46.000Z | tests/conftest.py | bjuergens/NaturalNets | fd67f1b3c443761270adaf9877ed2a6358d830f0 | [
"MIT"
] | 1 | 2021-11-03T09:36:40.000Z | 2021-11-03T09:36:40.000Z | import pytest
from naturalnets.brains.i_layer_based_brain import ILayerBasedBrainCfg
from tests.pytorch_brains import IPytorchBrainCfg
@pytest.fixture
def torch_config() -> IPytorchBrainCfg:
return IPytorchBrainCfg(type="GRU_PyTorch", num_layers=3,
hidden_size=8,
... | 29.947368 | 116 | 0.690685 | import pytest
from naturalnets.brains.i_layer_based_brain import ILayerBasedBrainCfg
from tests.pytorch_brains import IPytorchBrainCfg
@pytest.fixture
def torch_config() -> IPytorchBrainCfg:
return IPytorchBrainCfg(type="GRU_PyTorch", num_layers=3,
hidden_size=8,
... | true | true |
f7047d449813bf50ec7a45d643dec9de6b8286fc | 2,870 | py | Python | batch_rl/tests/fixed_replay_runner_test.py | anonymous-code-github/offline-rl | ebe1335bab9a83e95e5c93f33fa9d248218c37e6 | [
"Apache-2.0"
] | 3 | 2019-12-27T11:56:44.000Z | 2021-08-02T03:28:24.000Z | batch_rl/tests/fixed_replay_runner_test.py | anonymous-code-github/offline-rl | ebe1335bab9a83e95e5c93f33fa9d248218c37e6 | [
"Apache-2.0"
] | null | null | null | batch_rl/tests/fixed_replay_runner_test.py | anonymous-code-github/offline-rl | ebe1335bab9a83e95e5c93f33fa9d248218c37e6 | [
"Apache-2.0"
] | 1 | 2020-10-26T20:06:13.000Z | 2020-10-26T20:06:13.000Z | # coding=utf-8
#
#
# 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... | 33.764706 | 77 | 0.705923 |
import datetime
import os
import shutil
from absl import flags
from batch_rl.fixed_replay import train
import tensorflow as tf
FLAGS = flags.FLAGS
class FixedReplayRunnerIntegrationTest(tf.test.TestCase):
def setUp(self):
super(FixedReplayRunnerIntegrationTest, self).setUp()
FLAGS.base... | true | true |
f7047d5e3cb2e30fdd03da1ab9cfcef3096c0a9c | 124 | py | Python | automatedtest_backend/datasourcemanagement/forms.py | zhousheng0325/AutomationPlatform | e7e41e4a26c63fc8151b191bccb0f4a412a3388d | [
"MIT"
] | null | null | null | automatedtest_backend/datasourcemanagement/forms.py | zhousheng0325/AutomationPlatform | e7e41e4a26c63fc8151b191bccb0f4a412a3388d | [
"MIT"
] | 10 | 2020-06-06T01:30:29.000Z | 2022-03-12T00:16:52.000Z | automatedtest_backend/datasourcemanagement/forms.py | zhousheng0325/AutomationPlatform | e7e41e4a26c63fc8151b191bccb0f4a412a3388d | [
"MIT"
] | null | null | null | from django.forms import forms, ModelForm
class FileForm(forms.Form):
file_name = forms.FileField(label=u"文件名称")
| 20.666667 | 47 | 0.725806 | from django.forms import forms, ModelForm
class FileForm(forms.Form):
file_name = forms.FileField(label=u"文件名称")
| true | true |
f7047db12c36770b75c15cf10d8ae3d6e3572d9e | 1,130 | py | Python | automatia/main.py | ShadowJonathan/automatia.py | 555d473c11372b2eec14bcd7508b4593be4fba7f | [
"MIT"
] | 1 | 2018-01-01T21:41:46.000Z | 2018-01-01T21:41:46.000Z | automatia/main.py | ShadowJonathan/automatia.py | 555d473c11372b2eec14bcd7508b4593be4fba7f | [
"MIT"
] | null | null | null | automatia/main.py | ShadowJonathan/automatia.py | 555d473c11372b2eec14bcd7508b4593be4fba7f | [
"MIT"
] | null | null | null | from __future__ import print_function
import sys
CLI = False
DEBUG = False
AUTO = False
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def setdebug(state):
global DEBUG
DEBUG = state
Debug("Python:")
for p in sys.version.split("\n"):
Debug(p)
def setauto(state)... | 14.868421 | 63 | 0.576991 | from __future__ import print_function
import sys
CLI = False
DEBUG = False
AUTO = False
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def setdebug(state):
global DEBUG
DEBUG = state
Debug("Python:")
for p in sys.version.split("\n"):
Debug(p)
def setauto(state)... | true | true |
f7047e3ed18e6d703f78bf1fed08fcc4c23c345f | 97 | py | Python | apps/timelineApp/apps.py | sepmoon/django_blog_demo | e77bb452e9161f6749ad970e5af35ec9ff7dc7a4 | [
"MIT"
] | null | null | null | apps/timelineApp/apps.py | sepmoon/django_blog_demo | e77bb452e9161f6749ad970e5af35ec9ff7dc7a4 | [
"MIT"
] | null | null | null | apps/timelineApp/apps.py | sepmoon/django_blog_demo | e77bb452e9161f6749ad970e5af35ec9ff7dc7a4 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class TimelineappConfig(AppConfig):
name = 'timelineApp'
| 16.166667 | 35 | 0.773196 | from django.apps import AppConfig
class TimelineappConfig(AppConfig):
name = 'timelineApp'
| true | true |
f7047eabbda6b249e9c546173cdd8ebd6ff6c831 | 199 | py | Python | toai/data/DataContainer.py | KipperPipper/Library_test | bdc35c2f1a6f2deadb4d0b00e3f4d5c8a597efdf | [
"MIT"
] | null | null | null | toai/data/DataContainer.py | KipperPipper/Library_test | bdc35c2f1a6f2deadb4d0b00e3f4d5c8a597efdf | [
"MIT"
] | null | null | null | toai/data/DataContainer.py | KipperPipper/Library_test | bdc35c2f1a6f2deadb4d0b00e3f4d5c8a597efdf | [
"MIT"
] | null | null | null | from typing import Any
class DataContainer:
def __init__(self, train: Any, validation: Any, test: Any):
self.train = train
self.validation = validation
self.test = test
| 22.111111 | 63 | 0.653266 | from typing import Any
class DataContainer:
def __init__(self, train: Any, validation: Any, test: Any):
self.train = train
self.validation = validation
self.test = test
| true | true |
f7047f7a029de9eb32b46e72e4d79c7e0e4d1768 | 856 | py | Python | evidence/refs/EC.py | dprada/evidence | d8400fe1a3c662be01f6f9f658fc5b92b894556d | [
"MIT"
] | null | null | null | evidence/refs/EC.py | dprada/evidence | d8400fe1a3c662be01f6f9f658fc5b92b894556d | [
"MIT"
] | null | null | null | evidence/refs/EC.py | dprada/evidence | d8400fe1a3c662be01f6f9f658fc5b92b894556d | [
"MIT"
] | 1 | 2021-11-06T16:03:46.000Z | 2021-11-06T16:03:46.000Z | class EC():
def __init__(self, id=None):
self.database = 'EC'
self.id = id
self._long_name = 'EC (Enzyme Commission) number of the Nomenclature Committee of the International Union of Biochemistry and Molecular Biology (IUBMB) Database of Interacting Proteins'
self._web = 'https://... | 21.948718 | 193 | 0.571262 | class EC():
def __init__(self, id=None):
self.database = 'EC'
self.id = id
self._long_name = 'EC (Enzyme Commission) number of the Nomenclature Committee of the International Union of Biochemistry and Molecular Biology (IUBMB) Database of Interacting Proteins'
self._web = 'https://... | true | true |
f704808d9f26f3437b8901a6051505184f96036d | 1,539 | py | Python | home/urls.py | elizabethadegbaju/dailypythontip | 4d8271e7ae84fa5b35cbafdc00f51511f4769ba8 | [
"MIT"
] | null | null | null | home/urls.py | elizabethadegbaju/dailypythontip | 4d8271e7ae84fa5b35cbafdc00f51511f4769ba8 | [
"MIT"
] | null | null | null | home/urls.py | elizabethadegbaju/dailypythontip | 4d8271e7ae84fa5b35cbafdc00f51511f4769ba8 | [
"MIT"
] | null | null | null | """dailypythontip home app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/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='ho... | 38.475 | 77 | 0.680962 | from django.urls import path, include
from home import views
app_name = 'home'
apis = [
path('tips/', views.api_tip_list, name='api-tip-list'),
path('tips/<int:pk>/', views.api_tip_detail, name='api-tip-detail'),
]
urlpatterns = [
path('', views.index, name='index'),
path('retweet/<int:tweet_id>/', ... | true | true |
f7048288ff2459e2e28af319740b09d01ee29e5e | 2,967 | py | Python | python/privatelink-rds/lambda_function/elb_hostname_as_target.py | aarondodd/aws-cdk-examples | 7ac382fe99656df19a4f96159c11e0aa546acaf4 | [
"Apache-2.0"
] | null | null | null | python/privatelink-rds/lambda_function/elb_hostname_as_target.py | aarondodd/aws-cdk-examples | 7ac382fe99656df19a4f96159c11e0aa546acaf4 | [
"Apache-2.0"
] | null | null | null | python/privatelink-rds/lambda_function/elb_hostname_as_target.py | aarondodd/aws-cdk-examples | 7ac382fe99656df19a4f96159c11e0aa546acaf4 | [
"Apache-2.0"
] | 1 | 2022-01-31T03:13:37.000Z | 2022-01-31T03:13:37.000Z | import json
import logging
import os
import sys
import lambda_utils as utils
"""
Configure these environment variables in your Lambda environment or
CloudFormation Inputs settings):
1. TARGET_FQDN (mandatory): The Fully Qualified DNS Name used for application
cluster
2. ELB_TG_ARN (mandatory): The ARN of the Elastic... | 35.321429 | 180 | 0.70273 | import json
import logging
import os
import sys
import lambda_utils as utils
if 'TARGET_FQDN' in os.environ:
TARGET_FQDN = os.environ['TARGET_FQDN']
else:
print("ERROR: Missing Target Hostname.")
sys.exit(1)
if 'ELB_TG_ARN' in os.environ:
ELB_TG_ARN = os.environ['ELB_TG_ARN']
else:
print("ERROR:... | true | true |
f70482921da1a6ceac1e0f0ec127bbe000ad683e | 242 | py | Python | splash/teams/__init__.py | danielballan/splash-server | 8b45075cdc556f2559b126f0b157f7107677dff1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | splash/teams/__init__.py | danielballan/splash-server | 8b45075cdc556f2559b126f0b157f7107677dff1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | splash/teams/__init__.py | danielballan/splash-server | 8b45075cdc556f2559b126f0b157f7107677dff1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from typing import Dict, List
from pydantic import BaseModel, Extra
class NewTeam(BaseModel):
name: str
members: Dict[str, List[str]] # uid, role
class Config:
extra = Extra.forbid
class Team(NewTeam):
uid: str
| 15.125 | 46 | 0.665289 | from typing import Dict, List
from pydantic import BaseModel, Extra
class NewTeam(BaseModel):
name: str
members: Dict[str, List[str]]
class Config:
extra = Extra.forbid
class Team(NewTeam):
uid: str
| true | true |
f7048417b44c70cf49dfe6ef12bd1218e7cfb1d0 | 2,606 | py | Python | webinterface/tests/unit_tests/test_model_Assignment.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/tests/unit_tests/test_model_Assignment.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/tests/unit_tests/test_model_Assignment.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | from django.test import TestCase
from webinterface.models import *
class AssignmentTest(TestCase):
@classmethod
def setUpTestData(cls):
# Config
cls.reference_week = 2500
# Schedule
cls.schedule = Schedule.objects.create(name="schedule", cleaners_per_date=2, frequency=2, weekd... | 44.931034 | 116 | 0.719493 | from django.test import TestCase
from webinterface.models import *
class AssignmentTest(TestCase):
@classmethod
def setUpTestData(cls):
cls.reference_week = 2500
cls.schedule = Schedule.objects.create(name="schedule", cleaners_per_date=2, frequency=2, weekday=3)
... | true | true |
f70484d154241797478949be5dae4a97f46be7bc | 681 | py | Python | tests/ci/support/capture.py | Food-X-Technologies/foodx_devops_tools | 57d1bf1304d9c9a386eaffa427f9eb36c410c350 | [
"MIT"
] | 3 | 2021-06-23T20:53:43.000Z | 2022-01-26T14:19:43.000Z | tests/ci/support/capture.py | Food-X-Technologies/foodx_devops_tools | 57d1bf1304d9c9a386eaffa427f9eb36c410c350 | [
"MIT"
] | 33 | 2021-08-09T15:44:51.000Z | 2022-03-03T18:28:02.000Z | tests/ci/support/capture.py | Food-X-Technologies/foodx_devops_tools | 57d1bf1304d9c9a386eaffa427f9eb36c410c350 | [
"MIT"
] | 1 | 2021-06-23T20:53:52.000Z | 2021-06-23T20:53:52.000Z | # Copyright (c) 2021 Food-X Technologies
#
# This file is part of foodx_devops_tools.
#
# You should have received a copy of the MIT License along with
# foodx_devops_tools. If not, see <https://opensource.org/licenses/MIT>.
import contextlib
import io
import sys
@contextlib.contextmanager
def capture_stdout_stderr(... | 26.192308 | 72 | 0.704846 |
import contextlib
import io
import sys
@contextlib.contextmanager
def capture_stdout_stderr(reset_seek: bool = True) -> None:
new_stderr = io.StringIO()
new_stdout = io.StringIO()
with contextlib.redirect_stderr(
new_stderr
) as err, contextlib.redirect_stdout(new_stdout) as out:
... | true | true |
f70484f43b430780e5466cac40adaee0fd9e1e89 | 6,217 | py | Python | download.py | kjew2/DCGAN-tensorflow | 83b2eeec3f5a9ec12f8969259f8f7502d7f088f8 | [
"MIT"
] | null | null | null | download.py | kjew2/DCGAN-tensorflow | 83b2eeec3f5a9ec12f8969259f8f7502d7f088f8 | [
"MIT"
] | null | null | null | download.py | kjew2/DCGAN-tensorflow | 83b2eeec3f5a9ec12f8969259f8f7502d7f088f8 | [
"MIT"
] | null | null | null | """
Modification of https://github.com/stanfordnlp/treelstm/blob/master/scripts/download.py
Downloads the following:
- Celeb-A dataset
- LSUN dataset
- MNIST dataset
"""
from __future__ import print_function
import os
import sys
import gzip
import json
import shutil
import zipfile
import argparse
import requests
impo... | 30.179612 | 111 | 0.675728 |
from __future__ import print_function
import os
import sys
import gzip
import json
import shutil
import zipfile
import argparse
import requests
import subprocess
from tqdm import tqdm
from six.moves import urllib
parser = argparse.ArgumentParser(description='Download dataset for DCGAN.')
parser.add_argument('datasets... | true | true |
f704863df04687682f95a46d3c76f824da117302 | 5,105 | py | Python | src/Bubot/Core/Coap/coap/optiontypes.py | businka/bubot_Core | 9c393e25467e34229e36af4badb6c9caab4fed45 | [
"MIT"
] | null | null | null | src/Bubot/Core/Coap/coap/optiontypes.py | businka/bubot_Core | 9c393e25467e34229e36af4badb6c9caab4fed45 | [
"MIT"
] | null | null | null | src/Bubot/Core/Coap/coap/optiontypes.py | businka/bubot_Core | 9c393e25467e34229e36af4badb6c9caab4fed45 | [
"MIT"
] | null | null | null | # This file is part of the Python aiocoap library project.
#
# Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>,
# 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at>
#
# aiocoap is free software, this file is published under the MIT license as
# described in the accompany... | 30.568862 | 111 | 0.633497 |
import abc
import collections
import struct
class OptionType(metaclass=abc.ABCMeta):
@abc.abstractmethod
def __init__(self, number, value):
@abc.abstractmethod
def encode(self):
@abc.abstractmethod
def decode(self, rawdata):
@property
def length(self):
return len(s... | true | true |
f7048744d8474f46e17bf88b935ba327442038a6 | 7,930 | py | Python | Ch4/Jack_Car_Rental_Problem.py | ygutgutia/Reinforcement-Learning-2nd-Edition-by-Sutton-Codes | 545349260ff9895383bd9041b8cde23148d5691e | [
"MIT"
] | null | null | null | Ch4/Jack_Car_Rental_Problem.py | ygutgutia/Reinforcement-Learning-2nd-Edition-by-Sutton-Codes | 545349260ff9895383bd9041b8cde23148d5691e | [
"MIT"
] | null | null | null | Ch4/Jack_Car_Rental_Problem.py | ygutgutia/Reinforcement-Learning-2nd-Edition-by-Sutton-Codes | 545349260ff9895383bd9041b8cde23148d5691e | [
"MIT"
] | null | null | null | # https://towardsdatascience.com/elucidating-policy-iteration-in-reinforcement-learning-jacks-car-rental-problem-d41b34c8aec7
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import poisson
import sys
class Poisson:
def __init__(self, exp_num):
self.exp_num = exp_... | 39.257426 | 125 | 0.527112 |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import poisson
import sys
class Poisson:
def __init__(self, exp_num):
self.exp_num = exp_num
eps = 0.01
self.alpha = 0
state = 1
self.vals = {}
summer = 0
... | true | true |
f704874d903d18c8b7550ed375fc0e68ebb87d08 | 31,495 | py | Python | vkwave/api/methods/wall.py | peach-lasagna/vkwave | 2b752d61e94ed43ee703d3a88ecf69f6a4ffd9dd | [
"MIT"
] | 1 | 2021-01-02T00:53:32.000Z | 2021-01-02T00:53:32.000Z | vkwave/api/methods/wall.py | peach-lasagna/vkwave | 2b752d61e94ed43ee703d3a88ecf69f6a4ffd9dd | [
"MIT"
] | null | null | null | vkwave/api/methods/wall.py | peach-lasagna/vkwave | 2b752d61e94ed43ee703d3a88ecf69f6a4ffd9dd | [
"MIT"
] | null | null | null | from vkwave.types.responses import *
from ._category import Category
from ._utils import get_params
class Wall(Category):
async def check_copyright_link(
self, link: str, return_raw_response: bool = False,
) -> typing.Union[dict, BaseBoolResponse]:
"""
:param link:
:param retur... | 43.501381 | 680 | 0.635148 | from vkwave.types.responses import *
from ._category import Category
from ._utils import get_params
class Wall(Category):
async def check_copyright_link(
self, link: str, return_raw_response: bool = False,
) -> typing.Union[dict, BaseBoolResponse]:
params = get_params(locals())
raw_r... | true | true |
f704876ed9e49ed687c66cb9ce6b5baeb4b509fd | 4,281 | py | Python | train.py | sumanyumuku98/contrastive-unpaired-translation | 91738727123252e39c4e23f75f93cad737c0d718 | [
"BSD-3-Clause"
] | null | null | null | train.py | sumanyumuku98/contrastive-unpaired-translation | 91738727123252e39c4e23f75f93cad737c0d718 | [
"BSD-3-Clause"
] | null | null | null | train.py | sumanyumuku98/contrastive-unpaired-translation | 91738727123252e39c4e23f75f93cad737c0d718 | [
"BSD-3-Clause"
] | null | null | null | import time
import torch
from options.train_options import TrainOptions
from data import create_dataset
from models import create_model
from util.visualizer import Visualizer
if __name__ == '__main__':
opt = TrainOptions().parse() # get training options
dataset = create_dataset(opt) # create a dataset give... | 56.328947 | 186 | 0.647279 | import time
import torch
from options.train_options import TrainOptions
from data import create_dataset
from models import create_model
from util.visualizer import Visualizer
if __name__ == '__main__':
opt = TrainOptions().parse()
dataset = create_dataset(opt)
dataset_size = len(dataset)
mod... | true | true |
f70487a55e43f8764e423fd27ee4138a5eaf7f38 | 391 | py | Python | hymn256/wsgi.py | maximugisha/tuyimbe | cddab250b1eee38cfae045bb6568ff3ee9eb97d1 | [
"MIT"
] | null | null | null | hymn256/wsgi.py | maximugisha/tuyimbe | cddab250b1eee38cfae045bb6568ff3ee9eb97d1 | [
"MIT"
] | null | null | null | hymn256/wsgi.py | maximugisha/tuyimbe | cddab250b1eee38cfae045bb6568ff3ee9eb97d1 | [
"MIT"
] | null | null | null | """
WSGI config for hymn256 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hymn256.settings')
application = get_wsgi_application()
| true | true |
f704883ebae70ce2217c718634167b20dfa1b69f | 80,891 | py | Python | safety_gym/envs/engine.py | frederiknolte/safety-gym | a0b3354d4d8240ed9b2bc00ef511b70ccb0f08ea | [
"MIT"
] | null | null | null | safety_gym/envs/engine.py | frederiknolte/safety-gym | a0b3354d4d8240ed9b2bc00ef511b70ccb0f08ea | [
"MIT"
] | null | null | null | safety_gym/envs/engine.py | frederiknolte/safety-gym | a0b3354d4d8240ed9b2bc00ef511b70ccb0f08ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import gym
import gym.spaces
import numpy as np
from PIL import Image
from copy import deepcopy
from collections import OrderedDict
import mujoco_py
from mujoco_py import MjViewer, MujocoException, const, MjRenderContextOffscreen
from safety_gym.envs.world import World, Robot
import sys
# Dis... | 48.935874 | 134 | 0.597125 |
import gym
import gym.spaces
import numpy as np
from PIL import Image
from copy import deepcopy
from collections import OrderedDict
import mujoco_py
from mujoco_py import MjViewer, MujocoException, const, MjRenderContextOffscreen
from safety_gym.envs.world import World, Robot
import sys
COLOR_CIRCLE = np.array... | true | true |
f70488df322501ed07f436eac69534372c090903 | 1,444 | py | Python | example.py | b3nj1/pymyq | 4326c1f257e7a0a75f63b714a3076ee9a68b8e50 | [
"MIT"
] | null | null | null | example.py | b3nj1/pymyq | 4326c1f257e7a0a75f63b714a3076ee9a68b8e50 | [
"MIT"
] | null | null | null | example.py | b3nj1/pymyq | 4326c1f257e7a0a75f63b714a3076ee9a68b8e50 | [
"MIT"
] | null | null | null | """Run an example script to quickly test any MyQ account."""
import asyncio
from aiohttp import ClientSession
import pymyq
from pymyq.errors import MyQError
async def main() -> None:
"""Create the aiohttp session and run the example."""
async with ClientSession() as websession:
try:
myq ... | 36.1 | 70 | 0.543629 | import asyncio
from aiohttp import ClientSession
import pymyq
from pymyq.errors import MyQError
async def main() -> None:
async with ClientSession() as websession:
try:
myq = await pymyq.login(
'<EMAIL>', '<PASSWORD>', '<BRAND>', websession)
devices = await myq.g... | true | true |
f7048928a7d297e2b4664be530dbd2667335e776 | 3,841 | py | Python | deprecated_library/cisco_ucs_ldap_provider_group.py | dsoper2/ucsm-ansible-1 | 9eef898d016e8e2c5f07990385ec1b8885edc533 | [
"NTP"
] | 54 | 2017-05-30T19:22:23.000Z | 2021-12-17T07:36:55.000Z | deprecated_library/cisco_ucs_ldap_provider_group.py | dsoper2/ucsm-ansible-1 | 9eef898d016e8e2c5f07990385ec1b8885edc533 | [
"NTP"
] | 50 | 2017-05-10T07:37:09.000Z | 2021-07-26T18:23:30.000Z | deprecated_library/cisco_ucs_ldap_provider_group.py | dsoper2/ucsm-ansible-1 | 9eef898d016e8e2c5f07990385ec1b8885edc533 | [
"NTP"
] | 54 | 2017-05-08T05:31:23.000Z | 2021-11-16T09:34:32.000Z | #!/usr/bin/env python
from ansible.module_utils.basic import *
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: cisco_ucs_ldap_provider_group
short_description: configures ldap provider group on... | 25.269737 | 71 | 0.640198 |
from ansible.module_utils.basic import *
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: cisco_ucs_ldap_provider_group
short_description: configures ldap provider group on a cisco ucs server
v... | true | true |
f70489490e1b8c1b4079c911f6d33d11550ff384 | 377 | py | Python | cwProject/dog_account/migrations/0002_auto_20190220_1723.py | cs-fullstack-2019-spring/django-models-cw-gkg901 | 32b8b7135223077c75d6bcd151652cd41d7e0397 | [
"Apache-2.0"
] | null | null | null | cwProject/dog_account/migrations/0002_auto_20190220_1723.py | cs-fullstack-2019-spring/django-models-cw-gkg901 | 32b8b7135223077c75d6bcd151652cd41d7e0397 | [
"Apache-2.0"
] | null | null | null | cwProject/dog_account/migrations/0002_auto_20190220_1723.py | cs-fullstack-2019-spring/django-models-cw-gkg901 | 32b8b7135223077c75d6bcd151652cd41d7e0397 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.6 on 2019-02-20 17:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dog_account', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='account',
name='accountNumber',
... | 19.842105 | 47 | 0.591512 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dog_account', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='account',
name='accountNumber',
field=models.IntegerField(),
... | true | true |
f70489cf566dca16c2b91eb084c08e0f59fe21d2 | 356 | py | Python | tests/urls.py | francbartoli/dj-experiment | ae9ec2f651b75d02d7635e1cf4c50526eea9801f | [
"MIT"
] | null | null | null | tests/urls.py | francbartoli/dj-experiment | ae9ec2f651b75d02d7635e1cf4c50526eea9801f | [
"MIT"
] | 1 | 2019-07-20T07:41:04.000Z | 2019-07-20T11:30:49.000Z | tests/urls.py | francbartoli/dj-experiment | ae9ec2f651b75d02d7635e1cf4c50526eea9801f | [
"MIT"
] | 1 | 2019-07-08T00:47:32.000Z | 2019-07-08T00:47:32.000Z | # -*- coding: utf-8
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from django.contrib import admin
from dj_experiment.urls import urlpatterns as dj_experiment_urls
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^', include(dj_experiment_u... | 27.384615 | 70 | 0.764045 |
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from django.contrib import admin
from dj_experiment.urls import urlpatterns as dj_experiment_urls
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^', include(dj_experiment_urls, namespace='dj_... | true | true |
f7048b98109faef9310cc4e31f71785ba859e4ea | 19,483 | py | Python | recpkg/implicit.py | mianuddin/csc492_recommender_pkg | 3c89bb1f4ef2a34ed4f9bb6a99ae623eaee1954b | [
"MIT"
] | null | null | null | recpkg/implicit.py | mianuddin/csc492_recommender_pkg | 3c89bb1f4ef2a34ed4f9bb6a99ae623eaee1954b | [
"MIT"
] | null | null | null | recpkg/implicit.py | mianuddin/csc492_recommender_pkg | 3c89bb1f4ef2a34ed4f9bb6a99ae623eaee1954b | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.base import BaseEstimator
from tensorflow import keras
from .recommenders import KerasRecommender
class ItemPopularity(BaseEstimator):
"""Recommender based solely on interactions per item."""
def fit(self, X=None, y=None):
"""Fit the recommender from the training datas... | 40.337474 | 79 | 0.554073 | import numpy as np
from sklearn.base import BaseEstimator
from tensorflow import keras
from .recommenders import KerasRecommender
class ItemPopularity(BaseEstimator):
def fit(self, X=None, y=None):
unique, counts = np.unique(X[y == 1, 1], return_counts=True)
self.interactions_by_item = dict(zip(u... | true | true |
f7048cc1f1367b8bbc7b5e658a4723fa588322b0 | 8,478 | py | Python | main.py | lostnighter/PKUAutoSubmit | 7f40b7c195ec68bf117022df075d9829e06ca89d | [
"Apache-2.0"
] | null | null | null | main.py | lostnighter/PKUAutoSubmit | 7f40b7c195ec68bf117022df075d9829e06ca89d | [
"Apache-2.0"
] | null | null | null | main.py | lostnighter/PKUAutoSubmit | 7f40b7c195ec68bf117022df075d9829e06ca89d | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver import Firefox, Chrome, PhantomJS
... | 32.235741 | 92 | 0.677046 | from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver import Firefox, Chrome, PhantomJS
... | true | true |
f7048dc3bc27f061d6236db700af312ebf28f1f8 | 32,007 | py | Python | python/ray/tests/test_runtime_env.py | Yard1/ray | 5ed3f0ce35cb3c66447858b4fc66573a13421d9a | [
"Apache-2.0"
] | 1 | 2022-01-10T07:41:17.000Z | 2022-01-10T07:41:17.000Z | python/ray/tests/test_runtime_env.py | Yard1/ray | 5ed3f0ce35cb3c66447858b4fc66573a13421d9a | [
"Apache-2.0"
] | 47 | 2021-06-19T07:05:49.000Z | 2022-03-26T07:05:03.000Z | python/ray/tests/test_runtime_env.py | Yard1/ray | 5ed3f0ce35cb3c66447858b4fc66573a13421d9a | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import sys
import random
import tempfile
import time
import requests
from pathlib import Path
import ray
from ray.exceptions import RuntimeEnvSetupError
from ray._private.test_utils import (
run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition)
from ray._private.utils ... | 35.445183 | 79 | 0.643672 | import os
import pytest
import sys
import random
import tempfile
import time
import requests
from pathlib import Path
import ray
from ray.exceptions import RuntimeEnvSetupError
from ray._private.test_utils import (
run_string_as_driver, run_string_as_driver_nonblocking, wait_for_condition)
from ray._private.utils ... | true | true |
f7048dd5bea1be44951cd1d5882977c03e5f0d87 | 2,064 | py | Python | python/social/user.py | shashankgandham/darsy | 2726abcc177d340397b4b9c6bbfaca8df1555aab | [
"MIT"
] | null | null | null | python/social/user.py | shashankgandham/darsy | 2726abcc177d340397b4b9c6bbfaca8df1555aab | [
"MIT"
] | null | null | null | python/social/user.py | shashankgandham/darsy | 2726abcc177d340397b4b9c6bbfaca8df1555aab | [
"MIT"
] | null | null | null | import MySQLdb as sql
from config import sqlconfig
class users:
def __init__():
self.connection = sql.connect(
host=sqlconfig.host, user=sqlconfig.user, passwd=sqlconfig.passwd
)
self.cursor = self.connection.cursor()
def __del__():
self.cursor.close()
sel... | 30.352941 | 77 | 0.540213 | import MySQLdb as sql
from config import sqlconfig
class users:
def __init__():
self.connection = sql.connect(
host=sqlconfig.host, user=sqlconfig.user, passwd=sqlconfig.passwd
)
self.cursor = self.connection.cursor()
def __del__():
self.cursor.close()
sel... | true | true |
f7048e2f0a4416f13df925d4d6c59590417c1ebf | 3,054 | py | Python | utils/common.py | RAY-official/CryptonoteEvo-EasyMiner | 056d0b4ea129ce666c46fcc50a14a66da249540e | [
"MIT"
] | 2 | 2018-04-16T22:34:04.000Z | 2018-06-19T06:51:54.000Z | utils/common.py | RAY-official/CryptonoteEvo-EasyMiner | 056d0b4ea129ce666c46fcc50a14a66da249540e | [
"MIT"
] | 1 | 2021-01-03T06:20:09.000Z | 2021-01-03T06:20:09.000Z | utils/common.py | RAY-official/CryptonoteEvo-EasyMiner | 056d0b4ea129ce666c46fcc50a14a66da249540e | [
"MIT"
] | 5 | 2018-04-20T03:27:57.000Z | 2018-06-19T06:52:52.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
helper classes and functions
'''
import os, sys, string, hashlib
import re, textwrap
from unicodedata import normalize
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class DummyStream:
''' dummyStream behaves like a... | 25.663866 | 89 | 0.592993 |
import os, sys, string, hashlib
import re, textwrap
from unicodedata import normalize
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class DummyStream:
def __init__(self): pass
def write(self,data): pass
def read(self,data): pass
def flush(self): ... | true | true |
f7048e8d6bdc977b635892b006b5eb0649f3110a | 573 | py | Python | openCV_basics.py | Avisek1999/Face-recognition-using-OpenCV | 1d24b077f1ee23aa2fa9d7cac843a11a41fee243 | [
"Unlicense"
] | 3 | 2020-12-31T04:03:58.000Z | 2021-01-04T10:19:24.000Z | openCV_basics.py | Avisek1999/Face-recognition-using-OpenCV | 1d24b077f1ee23aa2fa9d7cac843a11a41fee243 | [
"Unlicense"
] | null | null | null | openCV_basics.py | Avisek1999/Face-recognition-using-OpenCV | 1d24b077f1ee23aa2fa9d7cac843a11a41fee243 | [
"Unlicense"
] | null | null | null | import cv2
import numpy as np
#load colored image
img_1 = cv2.imread("Images\\sunflower.png", 1)
#load grayscale image
img_2 = cv2.imread("Images\\sunflower.png", 0)
#resizing images
resized_img_1 = cv2.resize(img_1, (int(img_1.shape[1]/2), int(img_1.shape[0]/2)))
#printing images' shape(dimension)
pri... | 22.038462 | 82 | 0.717277 | import cv2
import numpy as np
img_1 = cv2.imread("Images\\sunflower.png", 1)
img_2 = cv2.imread("Images\\sunflower.png", 0)
resized_img_1 = cv2.resize(img_1, (int(img_1.shape[1]/2), int(img_1.shape[0]/2)))
print(img_1.shape)
print(img_2.shape)
#displaying the loaded images
cv2.imshow("Colored Imag... | true | true |
f7048f1a9a11cee84225e69d7beb21203457c55f | 3,978 | py | Python | docs/_ext/clientservergen.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | 424 | 2021-12-04T15:45:12.000Z | 2022-03-31T20:27:55.000Z | docs/_ext/clientservergen.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | 105 | 2021-12-03T21:25:29.000Z | 2022-03-31T22:36:59.000Z | docs/_ext/clientservergen.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | 38 | 2021-12-04T21:26:20.000Z | 2022-03-21T02:39:29.000Z | import glob
import json
from docutils import nodes
from sphinx.util.docutils import SphinxDirective
from sphinx.util import logging
def add_prop_attr_row(prop, attr, tbody, key = None):
desc_row = nodes.row()
tbody += desc_row
desc_row += nodes.entry()
desc_key_entry = nodes.entry()
desc_row += d... | 38.621359 | 107 | 0.621418 | import glob
import json
from docutils import nodes
from sphinx.util.docutils import SphinxDirective
from sphinx.util import logging
def add_prop_attr_row(prop, attr, tbody, key = None):
desc_row = nodes.row()
tbody += desc_row
desc_row += nodes.entry()
desc_key_entry = nodes.entry()
desc_row += d... | true | true |
f7048f5661e35d4d435933172495a0e02500488f | 871 | py | Python | Tools/bloat/BloatReport.py | studentutu/StereoKit | 560d0048a2b1bfd07362156ef417963a493c03f0 | [
"MIT"
] | null | null | null | Tools/bloat/BloatReport.py | studentutu/StereoKit | 560d0048a2b1bfd07362156ef417963a493c03f0 | [
"MIT"
] | null | null | null | Tools/bloat/BloatReport.py | studentutu/StereoKit | 560d0048a2b1bfd07362156ef417963a493c03f0 | [
"MIT"
] | null | null | null | # Works on Linux .sym files generated using the nm command
# Like this:
# nm -CSr --size-sort StereoKitC.sym > size.txt
import re
data = {}
file1 = open('size.txt', 'r')
while True:
line = file1.readline()
# if line is empty end of file is reached
if not line:
break
matches = re.search("(\... | 22.921053 | 82 | 0.566016 |
import re
data = {}
file1 = open('size.txt', 'r')
while True:
line = file1.readline()
if not line:
break
matches = re.search("(\w*) (\w*) (\w*) ([^_:<(]*)(?:[_:<(]*)([^_:<(]*)", line)
size = int(matches[2], 16)
namespace = matches[4]
if ' ' in namespace:
namespace... | true | true |
f7048fa3de1ae89344e12248110f1a92f5d66f51 | 3,013 | gyp | Python | ion/base/tests/base_tests.gyp | isabella232/ion-1 | ef47f3b824050499ce5c6f774b366f6c4dbce0af | [
"Apache-2.0"
] | 1 | 2020-03-12T12:49:31.000Z | 2020-03-12T12:49:31.000Z | ion/base/tests/base_tests.gyp | isabella232/ion-1 | ef47f3b824050499ce5c6f774b366f6c4dbce0af | [
"Apache-2.0"
] | null | null | null | ion/base/tests/base_tests.gyp | isabella232/ion-1 | ef47f3b824050499ce5c6f774b366f6c4dbce0af | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 28.424528 | 74 | 0.580153 |
{
'includes': [
'../../common.gypi',
],
'targets': [
{
'target_name': 'ionbase_test',
'includes': [
'../../dev/test_target.gypi',
],
'sources' : [
'allocatable_test.cc',
'allocationmanager_test.cc',
'allocator_test.cc',
'array... | true | true |
f704901a93e192ad8759e2788d6ef18e842361c1 | 3,891 | py | Python | SA.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | 1 | 2020-12-10T17:36:39.000Z | 2020-12-10T17:36:39.000Z | SA.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | null | null | null | SA.py | ccfelius/TravelingSalesMan | ebc3b960859590623c0eb301545cd093c41d157a | [
"MIT"
] | 1 | 2021-01-05T13:08:07.000Z | 2021-01-05T13:08:07.000Z | """ TSP SIMULATED ANNEALING """
# Imports
import math
import numpy as np
# read data from file
f = open("TSP-configurations/eil51.tsp.txt", "r")
# f = open("TSP-configurations/a280.tsp.txt", "r")
# f = open("TSP-configurations/pcb442.tsp.txt", "r")
network = f.readlines()[6:-1]
# create dictionary to store coordina... | 28.40146 | 85 | 0.57029 |
import math
import numpy as np
f = open("TSP-configurations/eil51.tsp.txt", "r")
network = f.readlines()[6:-1]
nodes = dict()
for node in network:
node = list(map(int, (list(filter(None, node.rstrip().rsplit(' '))))))
nodes[node[0]] = node[1:]
def get_distance(dictionary, city1, city2):
x = dic... | true | true |
f7049196395e122f4eca3d7334b860dc0235da5b | 3,601 | py | Python | src/networkx/algorithms/centrality/dispersion.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 184 | 2017-12-20T21:50:06.000Z | 2022-03-19T13:24:58.000Z | src/networkx/algorithms/centrality/dispersion.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 26 | 2020-03-24T18:07:06.000Z | 2022-03-12T00:12:27.000Z | src/networkx/algorithms/centrality/dispersion.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 136 | 2018-01-09T22:52:06.000Z | 2022-02-24T13:26:18.000Z | from itertools import combinations
__author__ = "\n".join(['Ben Edwards (bedwards@cs.unm.edu)',
'Huston Hedinger (h@graphalchemist.com)',
'Dan Schult (dschult@colgate.edu)'])
__all__ = ['dispersion']
def dispersion(G, u=None, v=None, normalized=True, alpha=1.0, b=0.0,... | 33.971698 | 80 | 0.55429 | from itertools import combinations
__author__ = "\n".join(['Ben Edwards (bedwards@cs.unm.edu)',
'Huston Hedinger (h@graphalchemist.com)',
'Dan Schult (dschult@colgate.edu)'])
__all__ = ['dispersion']
def dispersion(G, u=None, v=None, normalized=True, alpha=1.0, b=0.0,... | true | true |
f70493c9a0cc1f2c13dcbfc9dfb2210631e94583 | 2,512 | py | Python | PyMesh/third_party/json/test/thirdparty/imapdl/filterbr.py | VincentLefevre/3D-parallax | 8eab905fcc591e1bd7ddbbb01ad21427286c02e3 | [
"MIT"
] | 73 | 2021-01-05T07:25:51.000Z | 2022-03-17T20:46:01.000Z | PyMesh/third_party/json/test/thirdparty/imapdl/filterbr.py | VincentLefevre/3D-parallax | 8eab905fcc591e1bd7ddbbb01ad21427286c02e3 | [
"MIT"
] | 1 | 2021-01-05T11:45:36.000Z | 2021-01-05T20:55:28.000Z | PyMesh/third_party/json/test/thirdparty/imapdl/filterbr.py | VincentLefevre/3D-parallax | 8eab905fcc591e1bd7ddbbb01ad21427286c02e3 | [
"MIT"
] | 4 | 2021-01-05T10:27:50.000Z | 2021-01-06T12:02:57.000Z | #!/usr/bin/env python3
# 2017, Georg Sauthoff <mail@gms.tf>, GPLv3
import sys
def skip_comments(lines):
state = 0
for line in lines:
n = len(line)
l = ''
p = 0
while p < n:
if state == 0:
a = line.find('//', p)
b = line.find('/*', p)
if a > -1 and (a ... | 22.836364 | 63 | 0.446656 |
import sys
def skip_comments(lines):
state = 0
for line in lines:
n = len(line)
l = ''
p = 0
while p < n:
if state == 0:
a = line.find('//', p)
b = line.find('/*', p)
if a > -1 and (a < b or b == -1):
l += line[p:a]
p = n
... | true | true |
f70495bb0052a07d968c92ff79a3d057cb7c3203 | 1,096 | py | Python | backend/users/views.py | crowdbotics-apps/secretariado-28865 | 8f408879a0810cd1436e5131c650614cd8ffe996 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/users/views.py | crowdbotics-apps/secretariado-28865 | 8f408879a0810cd1436e5131c650614cd8ffe996 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/users/views.py | crowdbotics-apps/secretariado-28865 | 8f408879a0810cd1436e5131c650614cd8ffe996 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from .models import User
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from django.views.generic import (
RedirectView,
UpdateView,
DetailView,
CreateView,
ListView,
)
User = get_user_model()
class UserDeta... | 21.92 | 87 | 0.740876 | from .models import User
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from django.views.generic import (
RedirectView,
UpdateView,
DetailView,
CreateView,
ListView,
)
User = get_user_model()
class UserDeta... | true | true |
f7049608dda90179b124282c63b735b1d9d049b8 | 26 | py | Python | homeassistant/components/moon/__init__.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/moon/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/moon/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """The moon component."""
| 13 | 25 | 0.615385 | true | true | |
f70496db8e1118a8641f5a173b38fdd3b02d0c27 | 4,148 | py | Python | tests/main.py | mbhavya/fastapi | 1876ebc77949a9a254909ec61ea0c09365169ec2 | [
"MIT"
] | 1 | 2022-01-08T16:39:28.000Z | 2022-01-08T16:39:28.000Z | tests/main.py | mbhavya/fastapi | 1876ebc77949a9a254909ec61ea0c09365169ec2 | [
"MIT"
] | 1 | 2022-01-07T21:04:04.000Z | 2022-01-07T21:04:04.000Z | tests/main.py | mbhavya/fastapi | 1876ebc77949a9a254909ec61ea0c09365169ec2 | [
"MIT"
] | null | null | null | import http
from typing import Optional
from fastapi import FastAPI, Path, Query
app = FastAPI()
@app.api_route("/api_route")
def non_operation():
return {"message": "Hello World"}
def non_decorated_route():
return {"message": "Hello World"}
app.add_api_route("/non_decorated_route", non_decorated_route)... | 21.271795 | 83 | 0.695516 | import http
from typing import Optional
from fastapi import FastAPI, Path, Query
app = FastAPI()
@app.api_route("/api_route")
def non_operation():
return {"message": "Hello World"}
def non_decorated_route():
return {"message": "Hello World"}
app.add_api_route("/non_decorated_route", non_decorated_route)... | true | true |
f7049890a92c42d868eb4e25fb45d02dcc4f93fd | 4,411 | py | Python | scripts/build.py | nvrrdt/onzecurrency | 55ecc8b5bb38a19b344830d6da847b7f1f19c8b6 | [
"MIT"
] | null | null | null | scripts/build.py | nvrrdt/onzecurrency | 55ecc8b5bb38a19b344830d6da847b7f1f19c8b6 | [
"MIT"
] | null | null | null | scripts/build.py | nvrrdt/onzecurrency | 55ecc8b5bb38a19b344830d6da847b7f1f19c8b6 | [
"MIT"
] | null | null | null | import argparse
import sys
import os
import subprocess
from pathlib import Path
import threading
def main():
# Cd to scripts/build.py directory
os.chdir(os.path.dirname(__file__))
# Initialize parser
parser = argparse.ArgumentParser()
# Adding optional arguments
parser.add_argument("-r", ... | 42.009524 | 136 | 0.602584 | import argparse
import sys
import os
import subprocess
from pathlib import Path
import threading
def main():
os.chdir(os.path.dirname(__file__))
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--remove-build-dir", help = "Remove build directory", action="store_true")
... | true | true |
f70498c5a47f6ef9481f54711317f78fc1ab8f48 | 930 | py | Python | 3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/04. Exercise - Classes and Objects/07_spoopify/project/band.py | kzborisov/SoftUni | ccb2b8850adc79bfb2652a45124c3ff11183412e | [
"MIT"
] | 1 | 2021-02-07T07:51:12.000Z | 2021-02-07T07:51:12.000Z | 3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/04. Exercise - Classes and Objects/07_spoopify/project/band.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | 3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/04. Exercise - Classes and Objects/07_spoopify/project/band.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | from project.album import Album
class Band:
def __init__(self, name):
self.name = name
self.albums = []
def add_album(self, album: Album):
if album in self.albums:
return f"Band {self.name} already has {album.name} in their library."
self.albums.append(album)
... | 30 | 81 | 0.587097 | from project.album import Album
class Band:
def __init__(self, name):
self.name = name
self.albums = []
def add_album(self, album: Album):
if album in self.albums:
return f"Band {self.name} already has {album.name} in their library."
self.albums.append(album)
... | true | true |
f7049bcbc6fa44319a06c361bcb0eacc74d82e6b | 5,312 | py | Python | vagrant/vagrant/MPTCP_kernel5.5-WRR0.3_RPi4/mptcp_ctrl/mptcp_wrr_controller.py | jorgenavarroortiz/multitechnology_testbed_v0 | 970aa205d29de725f5c6501bac72cc9212eb4c8e | [
"Apache-2.0"
] | null | null | null | vagrant/vagrant/MPTCP_kernel5.5-WRR0.3_RPi4/mptcp_ctrl/mptcp_wrr_controller.py | jorgenavarroortiz/multitechnology_testbed_v0 | 970aa205d29de725f5c6501bac72cc9212eb4c8e | [
"Apache-2.0"
] | null | null | null | vagrant/vagrant/MPTCP_kernel5.5-WRR0.3_RPi4/mptcp_ctrl/mptcp_wrr_controller.py | jorgenavarroortiz/multitechnology_testbed_v0 | 970aa205d29de725f5c6501bac72cc9212eb4c8e | [
"Apache-2.0"
] | 1 | 2022-02-16T14:59:10.000Z | 2022-02-16T14:59:10.000Z | import ipaddress
import socket
import os
def execute_sysctl_command(params):
print("-> sysctl "+params)
os.system('sysctl ' + params)
def ip_string_to_unsigned_int(ip):
ip_ = 0
bytes_ = ip.split(".")
if len(bytes_) == 4:
ip_ = socket.htonl((int(bytes_[0]) << 24) + (int(bytes_[1]) << 16) +... | 32.588957 | 116 | 0.639307 | import ipaddress
import socket
import os
def execute_sysctl_command(params):
print("-> sysctl "+params)
os.system('sysctl ' + params)
def ip_string_to_unsigned_int(ip):
ip_ = 0
bytes_ = ip.split(".")
if len(bytes_) == 4:
ip_ = socket.htonl((int(bytes_[0]) << 24) + (int(bytes_[1]) << 16) +... | true | true |
f7049c852a7dbf185cd530f868f69bde4a8ef100 | 329 | py | Python | hidrocomp/files/nasa.py | clebsonpy/HydroComp | 9d17fa533e8a15c760030df5246ff531ddb4cb22 | [
"MIT"
] | 4 | 2020-05-14T20:03:49.000Z | 2020-05-22T19:56:43.000Z | hidrocomp/files/nasa.py | clebsonpy/HydroComp | 9d17fa533e8a15c760030df5246ff531ddb4cb22 | [
"MIT"
] | 19 | 2019-06-27T18:12:27.000Z | 2020-04-28T13:28:03.000Z | hidrocomp/files/nasa.py | clebsonpy/HydroComp | 9d17fa533e8a15c760030df5246ff531ddb4cb22 | [
"MIT"
] | null | null | null | """
Created on 21 de mar de 2018
@author: clebson
"""
from hidrocomp.files.fileRead import FileRead
class Nasa(FileRead):
"""
class files read: National Aeronautics and
Space Administration - NASA
"""
source = "NASA"
extension = "hdf5"
def __init__(self, params):
... | 17.315789 | 47 | 0.604863 | from hidrocomp.files.fileRead import FileRead
class Nasa(FileRead):
source = "NASA"
extension = "hdf5"
def __init__(self, params):
pass
| true | true |
f7049d22f74611a447ad986760f14af356310d64 | 4,983 | py | Python | rain_api_core/general_util.py | asfadmin/rain-api-core | 99985d4a346ab06449a42ed6b5b91f36d2bc760a | [
"Apache-2.0"
] | 1 | 2020-05-06T22:01:22.000Z | 2020-05-06T22:01:22.000Z | rain_api_core/general_util.py | asfadmin/rain-api-core | 99985d4a346ab06449a42ed6b5b91f36d2bc760a | [
"Apache-2.0"
] | 87 | 2019-09-16T20:45:59.000Z | 2022-03-31T21:18:44.000Z | rain_api_core/general_util.py | asfadmin/rain-api-core | 99985d4a346ab06449a42ed6b5b91f36d2bc760a | [
"Apache-2.0"
] | 2 | 2020-05-06T22:01:29.000Z | 2021-03-23T18:22:52.000Z | import logging
import os
import sys
import json
import time
import re
UNCENSORED_LOGGING = os.getenv("UNCENSORED_LOGGING")
LOG_CENSOR = [
{ "regex": r"(eyJ0e[A-Za-z0-9-_]{10})[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*([A-Za-z0-9-_]{10})",
"replace": "\\g<1>XXX<JWTTOKEN>XXX\\g<2>",
"des... | 36.372263 | 129 | 0.551074 | import logging
import os
import sys
import json
import time
import re
UNCENSORED_LOGGING = os.getenv("UNCENSORED_LOGGING")
LOG_CENSOR = [
{ "regex": r"(eyJ0e[A-Za-z0-9-_]{10})[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*([A-Za-z0-9-_]{10})",
"replace": "\\g<1>XXX<JWTTOKEN>XXX\\g<2>",
"des... | true | true |
f7049d363796cb6667a5daca0af53654e2731d01 | 1,237 | py | Python | localstack/services/kms/kms_starter.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | localstack/services/kms/kms_starter.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | localstack/services/kms/kms_starter.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | import logging
import platform
from localstack import config
from localstack.constants import TEST_AWS_ACCOUNT_ID
from localstack.services.infra import do_run, log_startup_message, start_proxy_for_service
from localstack.services.install import INSTALL_PATH_KMS_BINARY_PATTERN
from localstack.utils.common import get_ar... | 37.484848 | 91 | 0.754244 | import logging
import platform
from localstack import config
from localstack.constants import TEST_AWS_ACCOUNT_ID
from localstack.services.infra import do_run, log_startup_message, start_proxy_for_service
from localstack.services.install import INSTALL_PATH_KMS_BINARY_PATTERN
from localstack.utils.common import get_ar... | true | true |
f7049e63a0d463eea3205b339c8de1a0009f2c66 | 362 | py | Python | src/ralph/networks/migrations/0012_remove_network_dns_servers.py | DoNnMyTh/ralph | 97b91639fa68965ad3fd9d0d2652a6545a2a5b72 | [
"Apache-2.0"
] | 1,668 | 2015-01-01T12:51:20.000Z | 2022-03-29T09:05:35.000Z | src/ralph/networks/migrations/0012_remove_network_dns_servers.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 2,314 | 2015-01-02T13:26:26.000Z | 2022-03-29T04:06:03.000Z | src/ralph/networks/migrations/0012_remove_network_dns_servers.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 534 | 2015-01-05T12:40:28.000Z | 2022-03-29T21:10:12.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('networks', '0011_add_dns_servers_group'),
]
operations = [
migrations.RemoveField(
model_name='network',
... | 19.052632 | 51 | 0.61326 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('networks', '0011_add_dns_servers_group'),
]
operations = [
migrations.RemoveField(
model_name='network',
name='dns_servers'... | true | true |
f7049fbb24e7b82c25e46d99558fde78cfce0fcd | 16,602 | py | Python | Lib/unittest/test/test_program.py | juliangilbey/cpython | 3aa5242b54b0627293d95cfb4a26b2f917f667be | [
"0BSD"
] | 52,316 | 2015-01-01T15:56:25.000Z | 2022-03-31T23:19:01.000Z | Lib/unittest/test/test_program.py | juliangilbey/cpython | 3aa5242b54b0627293d95cfb4a26b2f917f667be | [
"0BSD"
] | 25,286 | 2015-03-03T23:18:02.000Z | 2022-03-31T23:17:27.000Z | Lib/unittest/test/test_program.py | yangruihan/cpython | 80e22edd4169241d16425bad0d0c4a074f5f5f99 | [
"0BSD"
] | 31,623 | 2015-01-01T13:29:37.000Z | 2022-03-31T19:55:06.000Z | import io
import os
import sys
import subprocess
from test import support
import unittest
import unittest.test
from .test_result import BufferedWriter
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expe... | 34.951579 | 103 | 0.585291 | import io
import os
import sys
import subprocess
from test import support
import unittest
import unittest.test
from .test_result import BufferedWriter
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expe... | true | true |
f704a1ff97c284787533ec880d3da162935ecff3 | 22 | py | Python | unit_test/__init__.py | whitews/ReFlowRESTClient | 69369bbea501382291b71facea7a511ab8f7848b | [
"BSD-3-Clause"
] | null | null | null | unit_test/__init__.py | whitews/ReFlowRESTClient | 69369bbea501382291b71facea7a511ab8f7848b | [
"BSD-3-Clause"
] | null | null | null | unit_test/__init__.py | whitews/ReFlowRESTClient | 69369bbea501382291b71facea7a511ab8f7848b | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'swhite'
| 11 | 21 | 0.727273 | __author__ = 'swhite'
| true | true |
f704a2cf5b5e1689076d0448825bb78481f3bd45 | 730 | py | Python | src/main.py | GoogleCloudPlatform/appengine-blobstoremgmt-python | 157883b45099b0e012273f321ac250d463dca8e7 | [
"Apache-2.0"
] | 2 | 2019-01-25T08:56:41.000Z | 2021-09-19T11:22:09.000Z | src/main.py | GoogleCloudPlatform/appengine-blobstoremgmt-python | 157883b45099b0e012273f321ac250d463dca8e7 | [
"Apache-2.0"
] | null | null | null | src/main.py | GoogleCloudPlatform/appengine-blobstoremgmt-python | 157883b45099b0e012273f321ac250d463dca8e7 | [
"Apache-2.0"
] | 5 | 2018-12-29T03:00:02.000Z | 2021-09-08T04:42:56.000Z | # Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.73913 | 74 | 0.761644 |
import webapp2
from app import routes
APP = webapp2.WSGIApplication(routes.ROUTES)
| true | true |
f704a3a4f2ec4e373be9ec1f21a6878561d4f135 | 2,192 | py | Python | mmseg/apis/ote/apis/segmentation/model_wrappers/blur.py | yunchu/mmsegmentation | 404f3e0e8859991931b6a39a583de412348e98f0 | [
"Apache-2.0"
] | null | null | null | mmseg/apis/ote/apis/segmentation/model_wrappers/blur.py | yunchu/mmsegmentation | 404f3e0e8859991931b6a39a583de412348e98f0 | [
"Apache-2.0"
] | null | null | null | mmseg/apis/ote/apis/segmentation/model_wrappers/blur.py | yunchu/mmsegmentation | 404f3e0e8859991931b6a39a583de412348e98f0 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 40.592593 | 127 | 0.734033 |
import cv2
import numpy as np
from typing import Any, Dict
from openvino.model_zoo.model_api.models import SegmentationModel
from openvino.model_zoo.model_api.models.types import NumericalValue
from ote_sdk.utils.segmentation_utils import create_hard_prediction_from_soft_prediction
class BlurSegmentati... | true | true |
f704a3b79279dcbc7d7c7af917820dc235520c9f | 1,506 | py | Python | metatags/templatetags/metatags.py | skylax1/django-simple-metatags | 6aa01733e60f8ad87f6bc3a8fb81c2cdfcb7a09c | [
"MIT"
] | null | null | null | metatags/templatetags/metatags.py | skylax1/django-simple-metatags | 6aa01733e60f8ad87f6bc3a8fb81c2cdfcb7a09c | [
"MIT"
] | null | null | null | metatags/templatetags/metatags.py | skylax1/django-simple-metatags | 6aa01733e60f8ad87f6bc3a8fb81c2cdfcb7a09c | [
"MIT"
] | null | null | null | from django.db import models
from django.template import Library
from ..models import MetaTag
from ..utils import truncate_language_code_from_path, check_caching_enabled
register = Library()
@register.inclusion_tag('metatags/includes/metatags.html', takes_context=True)
def include_metatags(context, model_instance=N... | 43.028571 | 114 | 0.727756 | from django.db import models
from django.template import Library
from ..models import MetaTag
from ..utils import truncate_language_code_from_path, check_caching_enabled
register = Library()
@register.inclusion_tag('metatags/includes/metatags.html', takes_context=True)
def include_metatags(context, model_instance=N... | true | true |
f704a42698e00cb319b9b229f831e142b1aebfcd | 154,799 | py | Python | nova/cmd/manage.py | muraliselva10/nova | 97626394bcce5c8cd020b136ca54a6aa919eb3a9 | [
"Apache-2.0"
] | null | null | null | nova/cmd/manage.py | muraliselva10/nova | 97626394bcce5c8cd020b136ca54a6aa919eb3a9 | [
"Apache-2.0"
] | null | null | null | nova/cmd/manage.py | muraliselva10/nova | 97626394bcce5c8cd020b136ca54a6aa919eb3a9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | 45.368992 | 79 | 0.598247 |
import collections
import functools
import os
import re
import sys
import time
import traceback
import typing as ty
from urllib import parse as urlparse
from dateutil import parser as dateutil_parser
from keystoneauth1 import exceptions as ks_exc
from neutronclient.common import exceptions as neutr... | true | true |
f704a5f03f32848876ade8470cc6ada426442677 | 18,070 | py | Python | src/python/pants/option/config.py | yoav-orca/pants | 995448e9add343975844c7a43d5d64618fc4e4d9 | [
"Apache-2.0"
] | 1,806 | 2015-01-05T07:31:00.000Z | 2022-03-31T11:35:41.000Z | src/python/pants/option/config.py | yoav-orca/pants | 995448e9add343975844c7a43d5d64618fc4e4d9 | [
"Apache-2.0"
] | 9,565 | 2015-01-02T19:01:59.000Z | 2022-03-31T23:25:16.000Z | src/python/pants/option/config.py | ryanking/pants | e45b00d2eb467b599966bca262405a5d74d27bdd | [
"Apache-2.0"
] | 443 | 2015-01-06T20:17:57.000Z | 2022-03-31T05:28:17.000Z | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import configparser
import getpass
import itertools
import os
import re
from abc import ABC, abstractmethod
from dataclasses import dataclass
from funct... | 35.087379 | 102 | 0.623962 |
from __future__ import annotations
import configparser
import getpass
import itertools
import os
import re
from abc import ABC, abstractmethod
from dataclasses import dataclass
from functools import partial
from hashlib import sha1
from typing import Any, ClassVar, Dict, Iterable, List, Mapping, Sequence, Union, ca... | true | true |
f704a614d6b4bbb4fa96e436b037a80284bc22d8 | 5,226 | py | Python | data_ocean/models.py | Alexandr8854/Data_converter | c5a144477a05ee11849a019bdedecc87f0167a24 | [
"MIT"
] | null | null | null | data_ocean/models.py | Alexandr8854/Data_converter | c5a144477a05ee11849a019bdedecc87f0167a24 | [
"MIT"
] | null | null | null | data_ocean/models.py | Alexandr8854/Data_converter | c5a144477a05ee11849a019bdedecc87f0167a24 | [
"MIT"
] | null | null | null | from django.db import models, connection
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
class DataOceanManager(models.Manager):
# exclude soft-deleted objects from queryset
def get_queryset(self):
return super().get_queryset().exclude(deleted_at__isnull=False)... | 37.869565 | 118 | 0.698622 | from django.db import models, connection
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
class DataOceanManager(models.Manager):
def get_queryset(self):
return super().get_queryset().exclude(deleted_at__isnull=False)
class DataOceanModel(models.Model):
n... | true | true |
f704a77ad9f0fe607dbc3fdafa7a9c077f619989 | 303 | py | Python | cgi-bin/createPod.py | raktim00/docker-k8s-webapp | 96c1ddd53e3c2a3a1fd1e258c4ee988d1db1bc10 | [
"MIT"
] | 3 | 2021-08-28T15:27:25.000Z | 2021-09-07T21:41:05.000Z | cgi-bin/createPod.py | adyraj/docker-k8s-webapp-1 | 96c1ddd53e3c2a3a1fd1e258c4ee988d1db1bc10 | [
"MIT"
] | null | null | null | cgi-bin/createPod.py | adyraj/docker-k8s-webapp-1 | 96c1ddd53e3c2a3a1fd1e258c4ee988d1db1bc10 | [
"MIT"
] | 7 | 2021-08-28T15:18:46.000Z | 2022-01-20T08:04:12.000Z | #!/usr/bin/python3
print("content-type: text/html")
print()
import cgi
import subprocess
F = cgi.FieldStorage()
pod_name = F.getvalue("podname")
img_name = F.getvalue("imgname")
output = subprocess.getoutput("sudo kubectl run {0} --image={1}".format(pod_name,img_name))
print("<pre>"+ output +"</pre") | 25.25 | 91 | 0.712871 |
print("content-type: text/html")
print()
import cgi
import subprocess
F = cgi.FieldStorage()
pod_name = F.getvalue("podname")
img_name = F.getvalue("imgname")
output = subprocess.getoutput("sudo kubectl run {0} --image={1}".format(pod_name,img_name))
print("<pre>"+ output +"</pre") | true | true |
f704a7bfc8e688c0824f6260a206d405a194c8ee | 1,042 | py | Python | Chapter09/Exercise03/preprocess_data.py | sixhobbits/Data-Storage-for-Artificial-Intelligence | af14abfeb4f091da1dadab5aa6c02801c50e70da | [
"MIT"
] | null | null | null | Chapter09/Exercise03/preprocess_data.py | sixhobbits/Data-Storage-for-Artificial-Intelligence | af14abfeb4f091da1dadab5aa6c02801c50e70da | [
"MIT"
] | null | null | null | Chapter09/Exercise03/preprocess_data.py | sixhobbits/Data-Storage-for-Artificial-Intelligence | af14abfeb4f091da1dadab5aa6c02801c50e70da | [
"MIT"
] | 1 | 2020-11-06T01:45:48.000Z | 2020-11-06T01:45:48.000Z | import argparse
import os
import json
from pathlib import Path
import pandas as pd
def parse_args():
parser = argparse.ArgumentParser(
prog="exercise 3",
description="preprocess meta data")
parser.add_argument('-f', '--file', type=str, required=True, help='meta data file path')
return parse... | 31.575758 | 92 | 0.658349 | import argparse
import os
import json
from pathlib import Path
import pandas as pd
def parse_args():
parser = argparse.ArgumentParser(
prog="exercise 3",
description="preprocess meta data")
parser.add_argument('-f', '--file', type=str, required=True, help='meta data file path')
return parse... | true | true |
f704a9ec0bd0458ff7d4ae73a21677388ae77e92 | 26,104 | py | Python | TensorFlow_implementation/Summary_Generator/Tensorflow_Graph/order_planner_without_copynet.py | shashankk24/natural-language-summary-generation-from-structured-data-master | a8bd083685ff7d5c0228588c47ddfcecba4cf78b | [
"MIT"
] | 187 | 2017-12-16T06:22:52.000Z | 2022-03-13T03:46:55.000Z | TensorFlow_implementation/Summary_Generator/Tensorflow_Graph/order_planner_without_copynet.py | shashankk24/natural-language-summary-generation-from-structured-data-master | a8bd083685ff7d5c0228588c47ddfcecba4cf78b | [
"MIT"
] | 12 | 2017-12-19T08:51:12.000Z | 2021-11-16T18:55:20.000Z | TensorFlow_implementation/Summary_Generator/Tensorflow_Graph/order_planner_without_copynet.py | shashankk24/natural-language-summary-generation-from-structured-data-master | a8bd083685ff7d5c0228588c47ddfcecba4cf78b | [
"MIT"
] | 54 | 2017-12-18T21:52:10.000Z | 2022-01-25T12:51:51.000Z | '''
This file generates the graph of the Model that we are going to use for the order planner for neural summary generator
The function returns the graph object and some of the important handles of the tensors of the graph in a dictionary.
Note, that all the possible tensor handles can be obtained by the tf... | 52.94929 | 132 | 0.57631 |
import tensorflow as tf
def get_computation_graph(seed_value, field_vocab_size, content_label_vocab_size, field_embedding_size,
content_label_embedding_size, lstm_cell_state_size, hidden_state_size, rev_content_label_dict):
tf.reset_default_graph()
graph = tf.Graph()
print("\n\n========... | true | true |
f704aa75697a4476188bfb2d6f8974c30f884072 | 747 | py | Python | info/trace.py | bingpo/dedecmscan | 879470f51a22f1f544b469d80fd2a88d692f116d | [
"Apache-2.0"
] | 751 | 2019-08-16T06:44:25.000Z | 2022-03-30T01:57:53.000Z | info/trace.py | W-Peter/dedecmscan | 42bc196f49e2930490b8f336025540a3d8329e7a | [
"Apache-2.0"
] | 2 | 2019-12-13T12:41:55.000Z | 2020-12-10T07:17:17.000Z | info/trace.py | W-Peter/dedecmscan | 42bc196f49e2930490b8f336025540a3d8329e7a | [
"Apache-2.0"
] | 143 | 2019-08-29T11:26:42.000Z | 2022-03-30T06:54:47.000Z | import requests
from termcolor import cprint
class trace:
def __init__(self,url):
self.url = url
def checktrace(self):
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
}
... | 29.88 | 149 | 0.552878 | import requests
from termcolor import cprint
class trace:
def __init__(self,url):
self.url = url
def checktrace(self):
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
}
... | true | true |
f704aa9b94fb0781bb3f5a2b471eb94d5c47c9fd | 1,388 | py | Python | projects/SparseRCNN/sparsercnn/config.py | henbucuoshanghai/sparsercnn | 77397aa4abbfeaa55a6be7e5672c05bee05ce442 | [
"MIT"
] | 1 | 2021-03-02T12:29:06.000Z | 2021-03-02T12:29:06.000Z | projects/SparseRCNN/sparsercnn/config.py | henbucuoshanghai/sparsercnn | 77397aa4abbfeaa55a6be7e5672c05bee05ce442 | [
"MIT"
] | null | null | null | projects/SparseRCNN/sparsercnn/config.py | henbucuoshanghai/sparsercnn | 77397aa4abbfeaa55a6be7e5672c05bee05ce442 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Modified by Peize Sun, Rufeng Zhang
# Contact: {sunpeize, cxrfzhang}@foxmail.com
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from detectron2.config import CfgNode as CN
def add_sparsercnn_config(cfg):
"""
Add config for SparseRCNN.
"""
cfg.MODEL... | 28.916667 | 70 | 0.695965 |
from detectron2.config import CfgNode as CN
def add_sparsercnn_config(cfg):
cfg.MODEL.SparseRCNN = CN()
cfg.MODEL.SparseRCNN.NUM_CLASSES = 80
cfg.MODEL.SparseRCNN.NUM_PROPOSALS = 300
cfg.MODEL.SparseRCNN.NHEADS = 8
cfg.MODEL.SparseRCNN.DROPOUT = 0.0
cfg.MODEL.SparseRCNN.DIM_FEEDFOR... | true | true |
f704aab5c4c2780c571cb3901a57f75dfb8b79dd | 2,101 | py | Python | python-client/trustedanalytics/tests/sources.py | skavulya/atk | c83f0bee2530282e39bf28d4a15355561b5eca4d | [
"Apache-2.0"
] | 1 | 2016-04-05T21:57:16.000Z | 2016-04-05T21:57:16.000Z | python-client/trustedanalytics/tests/sources.py | skavulya/atk | c83f0bee2530282e39bf28d4a15355561b5eca4d | [
"Apache-2.0"
] | null | null | null | python-client/trustedanalytics/tests/sources.py | skavulya/atk | c83f0bee2530282e39bf28d4a15355561b5eca4d | [
"Apache-2.0"
] | null | null | null | # vim: set encoding=utf-8
#
# Copyright (c) 2015 Intel Corporation
#
# 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... | 35.016667 | 106 | 0.653974 |
from collections import OrderedDict
class SimpleDataSource(object):
annotation = "simple"
def __init__(self, schema=None, rows=None, columns=None):
if not ((rows is None) ^ (columns is None)):
raise ValueError("Either rows or columns must be supplied")
if schema ... | true | true |
f704ab5ed7d678270f10502450721a8718967912 | 655 | py | Python | eeg_ml/data_loader/data_loaders.py | adam2392/eeg_ml | 374786526d7a51e9b9cf94822f045fd5b90858cb | [
"MIT"
] | null | null | null | eeg_ml/data_loader/data_loaders.py | adam2392/eeg_ml | 374786526d7a51e9b9cf94822f045fd5b90858cb | [
"MIT"
] | null | null | null | eeg_ml/data_loader/data_loaders.py | adam2392/eeg_ml | 374786526d7a51e9b9cf94822f045fd5b90858cb | [
"MIT"
] | null | null | null | from torchvision import datasets, transforms
from eeg_ml.base import BaseDataLoader
class MnistDataLoader(BaseDataLoader):
"""
MNIST data loading demo using BaseDataLoader
"""
def __init__(self, data_dir, batch_size, shuffle, validation_split, num_workers, training=True):
trsfm = transforms.C... | 36.388889 | 100 | 0.69771 | from torchvision import datasets, transforms
from eeg_ml.base import BaseDataLoader
class MnistDataLoader(BaseDataLoader):
def __init__(self, data_dir, batch_size, shuffle, validation_split, num_workers, training=True):
trsfm = transforms.Compose([
transforms.ToTensor(),
transform... | true | true |
f704abbec2b1b78577eaaa6369b7fcc9f2ab225f | 1,632 | py | Python | alttprbot/tournament/sgl21/twwr.py | skyscooby/sahasrahbot | 16fce824bd024f6357a8f260e2447ba477dcdac2 | [
"MIT"
] | null | null | null | alttprbot/tournament/sgl21/twwr.py | skyscooby/sahasrahbot | 16fce824bd024f6357a8f260e2447ba477dcdac2 | [
"MIT"
] | null | null | null | alttprbot/tournament/sgl21/twwr.py | skyscooby/sahasrahbot | 16fce824bd024f6357a8f260e2447ba477dcdac2 | [
"MIT"
] | null | null | null | import os
from alttprbot.tournament.core import TournamentConfig
from alttprbot_discord.bot import discordbot
from .sglcore import SGLCoreTournamentRace
class TWWR(SGLCoreTournamentRace):
async def configuration(self):
guild = discordbot.get_guild(590331405624410116)
return TournamentConfig(
... | 30.792453 | 74 | 0.624387 | import os
from alttprbot.tournament.core import TournamentConfig
from alttprbot_discord.bot import discordbot
from .sglcore import SGLCoreTournamentRace
class TWWR(SGLCoreTournamentRace):
async def configuration(self):
guild = discordbot.get_guild(590331405624410116)
return TournamentConfig(
... | true | true |
f704acaf0d0906ebdcf3194cb863c6e94506ef5d | 2,146 | py | Python | stubs.min/System/Windows/Forms/__init___parts/ToolStripRenderEventArgs.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/Windows/Forms/__init___parts/ToolStripRenderEventArgs.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/Forms/__init___parts/ToolStripRenderEventArgs.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class ToolStripRenderEventArgs(EventArgs):
"""
Provides data for the System.Windows.Forms.ToolStripRenderer.OnRenderImageMargin(System.Windows.Forms.ToolStripRenderEventArgs),System.Windows.Forms.ToolStripRenderer.OnRenderToolStripBorder(System.Windows.Forms.ToolStripRenderEventArgs),and System.Windows.Forms.ToolSt... | 42.078431 | 367 | 0.768872 | class ToolStripRenderEventArgs(EventArgs):
__new__(cls: type,g: Graphics,toolStrip: ToolStrip)
__new__(cls: type,g: Graphics,toolStrip: ToolStrip,affectedBounds: Rectangle,backColor: Color)
Get: AffectedBounds(self: ToolStripRenderEventArgs) -> Rectangle
ConnectedArea=property(lambda self: object(),lambda... | true | true |
f704acb27652fac4c53df6d424b7bb033879e704 | 15,975 | py | Python | CollisionAvoidanceMonitor/main.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | CollisionAvoidanceMonitor/main.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | CollisionAvoidanceMonitor/main.py | GustavLero/EPICS-inst_servers | 4bcdd6a80f1d9e074de3f0f7c66968d506981988 | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
import ode
import logging
import threading
from time import sleep, time
from genie_python.genie_startup import *
import pv_server
import render
from configurations import config_zoom as config
from collide import collide, CollisionDetector
from geometry import GeometryBox
from move import move_all... | 33.560924 | 119 | 0.587856 | import sys
import os
import ode
import logging
import threading
from time import sleep, time
from genie_python.genie_startup import *
import pv_server
import render
from configurations import config_zoom as config
from collide import collide, CollisionDetector
from geometry import GeometryBox
from move import move_all... | true | true |
f704aebb270ae5ced9b2f8e4f29e963b3e7dd7bd | 3,084 | py | Python | rbflayer.py | edwardstm/rbf_keras | 4029d1c15003438f7caadb9efefe0c026ba18933 | [
"MIT"
] | 1 | 2020-04-20T12:34:06.000Z | 2020-04-20T12:34:06.000Z | rbflayer.py | edwardstm/rbf_keras | 4029d1c15003438f7caadb9efefe0c026ba18933 | [
"MIT"
] | null | null | null | rbflayer.py | edwardstm/rbf_keras | 4029d1c15003438f7caadb9efefe0c026ba18933 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer
from tensorflow.keras.initializers import RandomUniform, Initializer, Constant
import numpy as np
class InitCentersRandom(Initializer):
""" Initializer for initialization of centers of RBF network
as... | 32.463158 | 79 | 0.552205 | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer
from tensorflow.keras.initializers import RandomUniform, Initializer, Constant
import numpy as np
class InitCentersRandom(Initializer):
def __init__(self, X):
self.X = X
def __call__(self, shap... | true | true |
f704af9532b46b3dbbc7284a567541674794e691 | 9,805 | py | Python | tools/data/build_rawframes.py | vt-vl-lab/video-data-aug | 01667cdbd1b952f2510af3422beeeb76e0d9e15a | [
"Apache-2.0"
] | 20 | 2021-03-31T02:25:20.000Z | 2022-03-11T11:45:59.000Z | tools/data/build_rawframes.py | vt-vl-lab/video-data-aug | 01667cdbd1b952f2510af3422beeeb76e0d9e15a | [
"Apache-2.0"
] | 6 | 2021-05-27T18:08:39.000Z | 2022-03-23T14:00:51.000Z | tools/data/build_rawframes.py | vt-vl-lab/video-data-aug | 01667cdbd1b952f2510af3422beeeb76e0d9e15a | [
"Apache-2.0"
] | 4 | 2021-03-31T03:11:45.000Z | 2021-08-22T11:11:45.000Z | import argparse
import glob
import os
import os.path as osp
import sys
import warnings
from multiprocessing import Pool
import mmcv
import numpy as np
# custom import
import pandas as pd
import pdb
def extract_frame(vid_item):
"""Generate optical flow using dense flow.
Args:
vid_item (list): Video ... | 37.140152 | 107 | 0.544416 | import argparse
import glob
import os
import os.path as osp
import sys
import warnings
from multiprocessing import Pool
import mmcv
import numpy as np
import pandas as pd
import pdb
def extract_frame(vid_item):
full_path, vid_path, vid_id, method, task = vid_item
if '/' in vid_path:
act_name = osp.b... | true | true |
f704b08c47257333fbfca18d0f73801f0031cb66 | 1,991 | py | Python | cliff/tests/test_formatters_value.py | serrollc/cliff | 1dd3edafab1a34d194c4510310653ad7e2cbb582 | [
"Apache-2.0"
] | null | null | null | cliff/tests/test_formatters_value.py | serrollc/cliff | 1dd3edafab1a34d194c4510310653ad7e2cbb582 | [
"Apache-2.0"
] | null | null | null | cliff/tests/test_formatters_value.py | serrollc/cliff | 1dd3edafab1a34d194c4510310653ad7e2cbb582 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env 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, s... | 30.166667 | 76 | 0.631341 |
import six
from cliff.formatters import value
from cliff.tests import test_columns
def test_value_formatter():
sf = value.ValueFormatter()
c = ('a', 'b', 'c', 'd')
d = ('A', 'B', 'C', '"no escape me"')
expected = 'A\nB\nC\n"no escape me"\n'
output = six.StringIO()
sf.emit_one(c,... | true | true |
f704b1b6e255bd26c9802820bac5475dcc418066 | 6,716 | py | Python | scraper/src/meilisearch_helper.py | myface-wang/docs-scraper | 86fa2130000b6d00b6a9520d176d02ea470aec2d | [
"MIT"
] | null | null | null | scraper/src/meilisearch_helper.py | myface-wang/docs-scraper | 86fa2130000b6d00b6a9520d176d02ea470aec2d | [
"MIT"
] | null | null | null | scraper/src/meilisearch_helper.py | myface-wang/docs-scraper | 86fa2130000b6d00b6a9520d176d02ea470aec2d | [
"MIT"
] | null | null | null | """MeiliSearchHelper
Wrapper on top of the MeiliSearch API client"""
import meilisearch
from builtins import range
def remove_bad_encoding(value):
return value.replace(''', "'")
def clean_one_field(value):
if isinstance(value, bool):
return str(value)
elif isinstance(value, str):
ret... | 34.618557 | 90 | 0.611078 |
import meilisearch
from builtins import range
def remove_bad_encoding(value):
return value.replace(''', "'")
def clean_one_field(value):
if isinstance(value, bool):
return str(value)
elif isinstance(value, str):
return remove_bad_encoding(value)
return value
def clean_dict(recor... | true | true |
f704b1f07f7a454874c406e6aa73fc6f56056467 | 1,848 | py | Python | moray/_browser/chrome.py | hirorich/moray | 69421ce739960c10c343ff1d72e1337594ea5c30 | [
"MIT"
] | null | null | null | moray/_browser/chrome.py | hirorich/moray | 69421ce739960c10c343ff1d72e1337594ea5c30 | [
"MIT"
] | null | null | null | moray/_browser/chrome.py | hirorich/moray | 69421ce739960c10c343ff1d72e1337594ea5c30 | [
"MIT"
] | null | null | null | """
chromeをアプリモードで起動するためのコマンドを生成する
"""
import sys, os
from moray.exception import SupportError
name = 'chrome'
def create_command(path, url, cmdline_args):
"""
起動コマンド生成
Attributes:
path (str): chromeコマンドのパス
url (str): 接続先のURL
cmdline_args (list<str>): コマンドライ... | 23.692308 | 85 | 0.581169 |
import sys, os
from moray.exception import SupportError
name = 'chrome'
def create_command(path, url, cmdline_args):
return [path, '--app=' + url] + cmdline_args
def find_path():
if sys.platform in ('win32', 'win64'):
return _find_chrome_windows()
els... | true | true |
f704b28f204b556b3ce64a8a530557cbeb92babb | 1,407 | py | Python | itspylearning/itslearning.py | HubertJan/itspylearning | 6110f87c78dfc5b78e8d52c0b05e2c376749bce3 | [
"MIT"
] | null | null | null | itspylearning/itslearning.py | HubertJan/itspylearning | 6110f87c78dfc5b78e8d52c0b05e2c376749bce3 | [
"MIT"
] | 1 | 2021-12-16T15:52:34.000Z | 2022-01-03T17:17:09.000Z | itspylearning/itslearning.py | HubertJan/itspylearning | 6110f87c78dfc5b78e8d52c0b05e2c376749bce3 | [
"MIT"
] | 1 | 2021-11-30T16:26:08.000Z | 2021-11-30T16:26:08.000Z | from typing import List, Optional
import aiohttp
import json
from aiohttp.client import ClientSession
from itspylearning.consts import ITSLEARNING_URL
from itspylearning.organisation import Organisation
_clientSession: Optional[ClientSession] = None
def _getClient() -> aiohttp.ClientSession:
global _clientSessi... | 31.977273 | 121 | 0.722814 | from typing import List, Optional
import aiohttp
import json
from aiohttp.client import ClientSession
from itspylearning.consts import ITSLEARNING_URL
from itspylearning.organisation import Organisation
_clientSession: Optional[ClientSession] = None
def _getClient() -> aiohttp.ClientSession:
global _clientSessi... | true | true |
f704b2a011d6048694d79069a8471cef3118250c | 2,356 | py | Python | backend/app/tests/api/node_directive/test_create.py | hollyfoxx/ace2-gui | e0f72cafdd524e0cd66549a9315697aa21ae46fa | [
"Apache-2.0"
] | 1 | 2021-07-16T10:34:22.000Z | 2021-07-16T10:34:22.000Z | backend/app/tests/api/node_directive/test_create.py | hollyfoxx/ace2-gui | e0f72cafdd524e0cd66549a9315697aa21ae46fa | [
"Apache-2.0"
] | null | null | null | backend/app/tests/api/node_directive/test_create.py | hollyfoxx/ace2-gui | e0f72cafdd524e0cd66549a9315697aa21ae46fa | [
"Apache-2.0"
] | null | null | null | import pytest
import uuid
from fastapi import status
#
# INVALID TESTS
#
@pytest.mark.parametrize(
"key,value",
[
("description", 123),
("description", ""),
("uuid", None),
("uuid", 1),
("uuid", "abc"),
("uuid", ""),
("value", 123),
("value", ... | 24.541667 | 84 | 0.629032 | import pytest
import uuid
from fastapi import status
@pytest.mark.parametrize(
"key,value",
[
("description", 123),
("description", ""),
("uuid", None),
("uuid", 1),
("uuid", "abc"),
("uuid", ""),
("value", 123),
("value", None),
("... | true | true |
f704b2ba2399a4abbde2614f88886205e3ef96db | 1,398 | py | Python | Transition.py | gerth2/FSMMaker | 933db1fb2bd4b88a62590c07a58842983b625d43 | [
"MIT"
] | null | null | null | Transition.py | gerth2/FSMMaker | 933db1fb2bd4b88a62590c07a58842983b625d43 | [
"MIT"
] | null | null | null | Transition.py | gerth2/FSMMaker | 933db1fb2bd4b88a62590c07a58842983b625d43 | [
"MIT"
] | null | null | null |
from Comparison import Comparison
from Action import Action
from TransitionCodegen import TransitionCodegen
from TransitionGraphic import TransitionGraphic
import xml.etree.ElementTree as ET
class Transition:
def __init__(self, id):
self.id = id
self.fromStateID = None
s... | 31.772727 | 81 | 0.557225 |
from Comparison import Comparison
from Action import Action
from TransitionCodegen import TransitionCodegen
from TransitionGraphic import TransitionGraphic
import xml.etree.ElementTree as ET
class Transition:
def __init__(self, id):
self.id = id
self.fromStateID = None
s... | true | true |
f704b2e0ef291ebe1fc31f07298db6d46894ad1c | 366 | py | Python | build/kinova-ros/kinova_bringup/catkin_generated/pkg.installspace.context.pc.py | Jam-cpu/Masters-Project---Final | 0b266b1f117a579b96507249f0a128d0e3cc082a | [
"BSD-3-Clause-Clear"
] | null | null | null | build/kinova-ros/kinova_bringup/catkin_generated/pkg.installspace.context.pc.py | Jam-cpu/Masters-Project---Final | 0b266b1f117a579b96507249f0a128d0e3cc082a | [
"BSD-3-Clause-Clear"
] | null | null | null | build/kinova-ros/kinova_bringup/catkin_generated/pkg.installspace.context.pc.py | Jam-cpu/Masters-Project---Final | 0b266b1f117a579b96507249f0a128d0e3cc082a | [
"BSD-3-Clause-Clear"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "kinova_bringup"
PROJECT_SPACE_DIR = "... | 40.666667 | 68 | 0.704918 |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "kinova_bringup"
PROJECT_SPACE_DIR = "/workspace/install"
PROJECT_VERSION = "0.0.0"
| true | true |
f704b34c87ed8874507207d4c03838d31c80bd03 | 113 | py | Python | pfdo_med2image/__init__.py | FNNDSC/pfdo_med2image | f65412aea362d0db5b8e7e2257b1d8fc1e696494 | [
"Apache-2.0"
] | null | null | null | pfdo_med2image/__init__.py | FNNDSC/pfdo_med2image | f65412aea362d0db5b8e7e2257b1d8fc1e696494 | [
"Apache-2.0"
] | 2 | 2020-08-18T21:47:22.000Z | 2021-03-12T14:45:35.000Z | pfdo_med2image/__init__.py | FNNDSC/pfdo_med2image | f65412aea362d0db5b8e7e2257b1d8fc1e696494 | [
"Apache-2.0"
] | 1 | 2020-11-12T21:40:01.000Z | 2020-11-12T21:40:01.000Z | try:
from .pfdo_med2image import pfdo_med2image
except:
from pfdo_med2image import pfdo_med2image
| 22.6 | 49 | 0.752212 | try:
from .pfdo_med2image import pfdo_med2image
except:
from pfdo_med2image import pfdo_med2image
| true | true |
f704b3d19693548dbf7626d9ff72c05289e02e97 | 226 | bzl | Python | BUILD.bzl | mobileink/coda | 0612b142738c68155e9a9bba16cd3787bba4feed | [
"Apache-2.0"
] | null | null | null | BUILD.bzl | mobileink/coda | 0612b142738c68155e9a9bba16cd3787bba4feed | [
"Apache-2.0"
] | 1 | 2021-03-06T14:52:32.000Z | 2021-03-06T14:52:32.000Z | BUILD.bzl | mobileink/coda | 0612b142738c68155e9a9bba16cd3787bba4feed | [
"Apache-2.0"
] | null | null | null | # CONFIG_MLH = ["//mina/config"]
CONFIG_MLH = select({
"//:profile_debug": ["//src/config/debug"],
"//:profile_dev": ["//src:dev"],
"//:profile_release": ["//src:release"],
}, no_match_error = "Unknown profile")
| 25.111111 | 47 | 0.588496 |
CONFIG_MLH = select({
"//:profile_debug": ["//src/config/debug"],
"//:profile_dev": ["//src:dev"],
"//:profile_release": ["//src:release"],
}, no_match_error = "Unknown profile")
| true | true |
f704b5b6daab1e1692d607b7bf7753465d5a41cd | 2,445 | py | Python | test/test_gbtile.py | flozz/img2gb | 2564a718d0b377d1b524204d97a674aedeec770d | [
"BSD-3-Clause"
] | 23 | 2018-11-14T12:50:31.000Z | 2022-03-30T17:28:43.000Z | test/test_gbtile.py | flozz/img2gb | 2564a718d0b377d1b524204d97a674aedeec770d | [
"BSD-3-Clause"
] | 10 | 2019-07-01T17:24:47.000Z | 2022-01-13T12:38:38.000Z | test/test_gbtile.py | flozz/img2gb | 2564a718d0b377d1b524204d97a674aedeec770d | [
"BSD-3-Clause"
] | 3 | 2019-10-16T23:27:28.000Z | 2022-01-23T22:28:29.000Z | import pytest
from PIL import Image
from img2gb.gbtile import GBTile
class Test_GBTile(object):
@pytest.fixture
def image(self):
return Image.open("./test/assets/tileset.png")
@pytest.mark.parametrize("x,result", [
(0, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"),
(8, "FF... | 28.430233 | 96 | 0.566871 | import pytest
from PIL import Image
from img2gb.gbtile import GBTile
class Test_GBTile(object):
@pytest.fixture
def image(self):
return Image.open("./test/assets/tileset.png")
@pytest.mark.parametrize("x,result", [
(0, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"),
(8, "FF... | true | true |
f704b74596dc89d75957ad11f92f138e450dc2bd | 2,050 | py | Python | mathics/profile.py | jake100/Mathics | f90f9107e12072dcfbd76549b61897bc8feb04a8 | [
"Apache-2.0"
] | 1 | 2019-04-15T13:18:05.000Z | 2019-04-15T13:18:05.000Z | mathics/profile.py | jake100/Mathics | f90f9107e12072dcfbd76549b61897bc8feb04a8 | [
"Apache-2.0"
] | null | null | null | mathics/profile.py | jake100/Mathics | f90f9107e12072dcfbd76549b61897bc8feb04a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
u"""
Mathics: a general-purpose computer algebra system
Copyright (C) 2011-2013 The Mathics Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ver... | 30.147059 | 79 | 0.643902 |
import cProfile
import pstats
from mathics.core.definitions import Definitions
from mathics.core.evaluation import Evaluation
definitions = Definitions(add_builtin=True)
def prepare():
pass
result = None
def run():
global result
try:
... | true | true |
f704b79922c2bcb710beb9717a76fb07b5ab4af6 | 390 | py | Python | beagle/transformers/__init__.py | truongdo619/beagle | 55a5d30a381438ae66b6c1c57f57b2403621db87 | [
"MIT"
] | 1 | 2019-10-01T19:26:16.000Z | 2019-10-01T19:26:16.000Z | beagle/transformers/__init__.py | truongdo619/beagle | 55a5d30a381438ae66b6c1c57f57b2403621db87 | [
"MIT"
] | null | null | null | beagle/transformers/__init__.py | truongdo619/beagle | 55a5d30a381438ae66b6c1c57f57b2403621db87 | [
"MIT"
] | 1 | 2019-10-04T15:30:08.000Z | 2019-10-04T15:30:08.000Z | from __future__ import absolute_import
from .base_transformer import Transformer # noqa
from .fireeye_hx_transformer import FireEyeHXTransformer # noqa
from .generic_transformer import GenericTransformer # noqa
from .sysmon_transformer import SysmonTransformer # noqa
from .evtx_transformer import WinEVTXTransforme... | 43.333333 | 64 | 0.848718 | from __future__ import absolute_import
from .base_transformer import Transformer
from .fireeye_hx_transformer import FireEyeHXTransformer
from .generic_transformer import GenericTransformer
from .sysmon_transformer import SysmonTransformer
from .evtx_transformer import WinEVTXTransformer
from .procmon_transf... | true | true |
f704b7dccf154ecda012dac0c1c0edf8a17dd5c2 | 804 | py | Python | setup.py | jsleb333/py2tex | 737292bc53115310a7e495a3781c84a3fe53b57e | [
"MIT"
] | 3 | 2019-02-11T19:14:08.000Z | 2019-02-11T22:47:15.000Z | setup.py | jsleb333/py2tex | 737292bc53115310a7e495a3781c84a3fe53b57e | [
"MIT"
] | null | null | null | setup.py | jsleb333/py2tex | 737292bc53115310a7e495a3781c84a3fe53b57e | [
"MIT"
] | null | null | null | import setuptools
from version import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="python2latex",
version=__version__,
author="Jean-Samuel Leboeuf",
author_email="jean-samuel.leboeuf.1@ulaval.ca",
description="A Python to LaTeX converter",... | 30.923077 | 62 | 0.677861 | import setuptools
from version import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="python2latex",
version=__version__,
author="Jean-Samuel Leboeuf",
author_email="jean-samuel.leboeuf.1@ulaval.ca",
description="A Python to LaTeX converter",... | true | true |
f704b88ab2cda09b5ebb43639854a0c2c0509468 | 10,852 | py | Python | as/tools/generator.py | Xuyiyang23333/asbot | c3b8a88e0970c1b39f9f7575f64b3fc3fe5161ba | [
"MIT"
] | null | null | null | as/tools/generator.py | Xuyiyang23333/asbot | c3b8a88e0970c1b39f9f7575f64b3fc3fe5161ba | [
"MIT"
] | null | null | null | as/tools/generator.py | Xuyiyang23333/asbot | c3b8a88e0970c1b39f9f7575f64b3fc3fe5161ba | [
"MIT"
] | null | null | null | from PIL import Image, ImageDraw, ImageFont
import numpy as np
from decimal import Decimal, ROUND_HALF_UP
from math import radians, tan, cos, sin
from os import path
_round = lambda f, r=ROUND_HALF_UP: int(Decimal(str(f)).quantize(Decimal("0"), rounding=r))
rgb = lambda r, g, b: (r, g, b)
upper_font_path = p... | 40.950943 | 121 | 0.570217 | from PIL import Image, ImageDraw, ImageFont
import numpy as np
from decimal import Decimal, ROUND_HALF_UP
from math import radians, tan, cos, sin
from os import path
_round = lambda f, r=ROUND_HALF_UP: int(Decimal(str(f)).quantize(Decimal("0"), rounding=r))
rgb = lambda r, g, b: (r, g, b)
upper_font_path = p... | true | true |
f704b95c88cfabc1dac0e794e4484161cd8c29c9 | 5,893 | py | Python | idiota/data.py | prakashsellathurai/idiota | e3cebb669bc5d04f30279c15939465aec2495eb6 | [
"Apache-2.0"
] | null | null | null | idiota/data.py | prakashsellathurai/idiota | e3cebb669bc5d04f30279c15939465aec2495eb6 | [
"Apache-2.0"
] | null | null | null | idiota/data.py | prakashsellathurai/idiota | e3cebb669bc5d04f30279c15939465aec2495eb6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Idiota object types
tree - A tree (directory listing) object that represents the directory structure in a tree object.
commit(ref) - A object that represents the changes in a single commit.
blob - A blob object that represents a file or a piece of... | 22.32197 | 102 | 0.589004 |
__author__ = "prakashsellathurai"
__copyright__ = "Copyright 2021"
__version__ = "1.0.1"
__email__ = "prakashsellathurai@gmail.com"
import os
import hashlib
import shutil
import json
from collections import namedtuple
from contextlib import contextmanager
GIT_DIR = None
RefValue = namedtuple('RefValue', ['symbo... | true | true |
f704b968b6da8f6293a4c1d3f9417ce9c6268bfa | 15,401 | py | Python | libcxx/utils/libcxx/test/newformat.py | LevyForchh/llvm-project | 904c0865dfaef343245d6496623f187c4cdc1b61 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/libcxx/test/newformat.py | LevyForchh/llvm-project | 904c0865dfaef343245d6496623f187c4cdc1b61 | [
"Apache-2.0"
] | 9 | 2020-04-24T21:51:04.000Z | 2020-11-06T01:04:09.000Z | libcxx/utils/libcxx/test/newformat.py | LevyForchh/llvm-project | 904c0865dfaef343245d6496623f187c4cdc1b61 | [
"Apache-2.0"
] | null | null | null | #===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------... | 50.661184 | 128 | 0.60087 |
mport lit
import os
import pipes
import re
import subprocess
class CxxStandardLibraryTest(lit.formats.TestFormat):
def getTestsInDirectory(self, testSuite, pathInSuite, litConfig, localConfig):
SUPPORTED_SUFFIXES = ['[.]pass[.]cpp$', '[.]pass[.]mm$', '[.]run[.]fail[.]cpp$',
... | true | true |
f704b9fd1df872c794b4f8b835d03462af5fb8c8 | 3,282 | py | Python | UpWork_Projects/Will Farell_Spiders/innerwest/innerwest/settings.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | null | null | null | UpWork_Projects/Will Farell_Spiders/innerwest/innerwest/settings.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | null | null | null | UpWork_Projects/Will Farell_Spiders/innerwest/innerwest/settings.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | 1 | 2022-01-18T17:15:51.000Z | 2022-01-18T17:15:51.000Z | # -*- coding: utf-8 -*-
# Scrapy settings for innerwest project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/t... | 34.1875 | 103 | 0.777575 |
BOT_NAME = 'Googlebot'
SPIDER_MODULES = ['innerwest.spiders']
NEWSPIDER_MODULE = 'innerwest.spiders'
ROBOTSTXT_OBEY = False
DOWNLOADER_MIDDLEWARES = {
'scrapy_selenium.SeleniumMiddleware': 800,
}
'chrome'
SELENIUM_DRIVER_EXECUTABLE_PATH = "../chromedrive... | true | true |
f704bd254ad35face9e7faddd989b36650dfdd68 | 5,649 | py | Python | templates/domain/extensions/bam.py | ipcrm/fmw_domain | b8cd3cbf25710df7fbce1cc3f468595543f7f272 | [
"MIT"
] | null | null | null | templates/domain/extensions/bam.py | ipcrm/fmw_domain | b8cd3cbf25710df7fbce1cc3f468595543f7f272 | [
"MIT"
] | null | null | null | templates/domain/extensions/bam.py | ipcrm/fmw_domain | b8cd3cbf25710df7fbce1cc3f468595543f7f272 | [
"MIT"
] | null | null | null | execfile('<%= @tmp_dir %>/common.py')
# weblogic node params
WLHOME = '<%= @weblogic_home_dir %>'
JAVA_HOME = '<%= @java_home_dir %>'
WEBLOGIC_VERSION = '<%= @version %>'
# domain params
DOMAIN_PATH = '<%= @domain_dir %>'
DOMAIN = '<%= @domain_name %>'
APP_PATH = '<%= @app_d... | 29.26943 | 144 | 0.681537 | execfile('<%= @tmp_dir %>/common.py')
WLHOME = '<%= @weblogic_home_dir %>'
JAVA_HOME = '<%= @java_home_dir %>'
WEBLOGIC_VERSION = '<%= @version %>'
DOMAIN_PATH = '<%= @domain_dir %>'
DOMAIN = '<%= @domain_name %>'
APP_PATH = '<%= @app_dir %>'
ADMIN_SERVER_NAME ... | false | true |
f704bd5d6983569ac694551a583366b858070681 | 4,151 | py | Python | legged_gym/envs/anymal_c/anymal.py | mcx/legged_gym | dd6a6892e54c4f111a203319c05da8dca9595ae1 | [
"BSD-3-Clause"
] | 159 | 2021-10-30T02:53:14.000Z | 2022-03-31T20:59:20.000Z | legged_gym/envs/anymal_c/anymal.py | mcx/legged_gym | dd6a6892e54c4f111a203319c05da8dca9595ae1 | [
"BSD-3-Clause"
] | 13 | 2021-11-01T06:57:56.000Z | 2022-03-19T07:16:47.000Z | legged_gym/envs/anymal_c/anymal.py | mcx/legged_gym | dd6a6892e54c4f111a203319c05da8dca9595ae1 | [
"BSD-3-Clause"
] | 49 | 2021-11-01T03:00:38.000Z | 2022-03-31T21:00:30.000Z | # SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of sourc... | 51.246914 | 161 | 0.747049 |
from time import time
import numpy as np
import os
from isaacgym.torch_utils import *
from isaacgym import gymtorch, gymapi, gymutil
import torch
from typing import Tuple, Dict
from legged_gym.envs import LeggedRobot
from legged_gym import LEGGED_GYM_ROOT_DIR
from .mixed_terrains.anyma... | true | true |
f704bde830d47e285d80fa6723a8d574657b41c6 | 2,358 | py | Python | clcd/rnn_train/RNNConfig.py | felipessalvatore/CLCD | 422f9e93d49e4fcfd8048ad5b36898f8713d0370 | [
"MIT"
] | 4 | 2020-02-06T19:35:13.000Z | 2021-09-04T10:29:11.000Z | clcd/rnn_train/RNNConfig.py | felipessalvatore/CLCD | 422f9e93d49e4fcfd8048ad5b36898f8713d0370 | [
"MIT"
] | null | null | null | clcd/rnn_train/RNNConfig.py | felipessalvatore/CLCD | 422f9e93d49e4fcfd8048ad5b36898f8713d0370 | [
"MIT"
] | null | null | null | class RNNConfig(object):
"""
Holds logistic regression model hyperparams.
:param height: image height
:type heights: int
:param width: image width
:type width: int
:param channels: image channels
:type channels: int
:param batch_size: batch size for training
:type batch_size: in... | 34.173913 | 67 | 0.56743 | class RNNConfig(object):
def __init__(self,
vocab_size=25000,
batch_size=32,
embedding_dim=100,
rnn_dim=100,
output_dim=2,
layers=1,
epochs=8,
learning_rate=0.01,
... | true | true |
f704bec2aa2f0c4a7762297c633a64db6aef42a5 | 231 | py | Python | Problems/HackerRank/weird.py | kvlizhvn/Lab_7 | e7f7f8da2b5f52a426bb55981594fb8ddcbd127a | [
"MIT"
] | 1 | 2022-02-18T15:44:46.000Z | 2022-02-18T15:44:46.000Z | Problems/HackerRank/weird.py | kvlizhvn/Lab_7 | e7f7f8da2b5f52a426bb55981594fb8ddcbd127a | [
"MIT"
] | null | null | null | Problems/HackerRank/weird.py | kvlizhvn/Lab_7 | e7f7f8da2b5f52a426bb55981594fb8ddcbd127a | [
"MIT"
] | 1 | 2021-03-26T13:55:52.000Z | 2021-03-26T13:55:52.000Z | if __name__ == '__main__':
n = int(input().strip())
if n % 2 != 0:
print("Weird")
elif 2 <= n <= 5:
print("Not Weird")
elif 6 <= n <= 20:
print("Weird")
else:
print("Not Weird")
| 19.25 | 28 | 0.441558 | if __name__ == '__main__':
n = int(input().strip())
if n % 2 != 0:
print("Weird")
elif 2 <= n <= 5:
print("Not Weird")
elif 6 <= n <= 20:
print("Weird")
else:
print("Not Weird")
| true | true |
f704bf1e7920df37e01acd48750fcd9d28294a7e | 1,913 | py | Python | tools/client.py | gitter-badger/electrs | a797a3864e1215a671b1d6a4efa5268c96d3f55d | [
"MIT"
] | null | null | null | tools/client.py | gitter-badger/electrs | a797a3864e1215a671b1d6a4efa5268c96d3f55d | [
"MIT"
] | null | null | null | tools/client.py | gitter-badger/electrs | a797a3864e1215a671b1d6a4efa5268c96d3f55d | [
"MIT"
] | null | null | null | import hashlib
import json
import sys
from logbook import Logger, StreamHandler
from pycoin.coins.bitcoin.networks import BitcoinMainnet
import pycoin.ui.key_from_text
import pycoin.key
import socket
script_for_address = BitcoinMainnet.ui.script_for_address
log = Logger(__name__)
class Connection:
def __init_... | 28.984848 | 74 | 0.547308 | import hashlib
import json
import sys
from logbook import Logger, StreamHandler
from pycoin.coins.bitcoin.networks import BitcoinMainnet
import pycoin.ui.key_from_text
import pycoin.key
import socket
script_for_address = BitcoinMainnet.ui.script_for_address
log = Logger(__name__)
class Connection:
def __init_... | true | true |
f704c0b981e5c808fcf2d361794e61ab733573e8 | 400 | py | Python | backend/auth/urls.py | Aquinology/Inel_Music | 15fe344e9932389df09e6219d2b1ae030cfd1219 | [
"MIT"
] | null | null | null | backend/auth/urls.py | Aquinology/Inel_Music | 15fe344e9932389df09e6219d2b1ae030cfd1219 | [
"MIT"
] | null | null | null | backend/auth/urls.py | Aquinology/Inel_Music | 15fe344e9932389df09e6219d2b1ae030cfd1219 | [
"MIT"
] | 1 | 2021-02-18T11:20:34.000Z | 2021-02-18T11:20:34.000Z | from django.urls import path
from .views import MyObtainTokenPairView, RegisterView
from rest_framework_simplejwt.views import TokenRefreshView
urlpatterns = [
path('login/', MyObtainTokenPairView.as_view(), name='token_obtain_pair'),
path('login/refresh/', TokenRefreshView.as_view(), name='token_refre... | 36.363636 | 79 | 0.75 | from django.urls import path
from .views import MyObtainTokenPairView, RegisterView
from rest_framework_simplejwt.views import TokenRefreshView
urlpatterns = [
path('login/', MyObtainTokenPairView.as_view(), name='token_obtain_pair'),
path('login/refresh/', TokenRefreshView.as_view(), name='token_refre... | true | true |
f704c0f9b4488488f3aae9f679bb84275d8e52d4 | 11,405 | py | Python | src/core/src/core_logic/PackageFilter.py | Azure/LinuxPatchExtension | 6af622afb4298805bdf47328d6bc66a785f7166b | [
"Apache-2.0"
] | 4 | 2020-06-01T14:36:30.000Z | 2021-08-24T16:55:50.000Z | src/core/src/core_logic/PackageFilter.py | Azure/LinuxPatchExtension | 6af622afb4298805bdf47328d6bc66a785f7166b | [
"Apache-2.0"
] | 34 | 2020-09-11T17:20:42.000Z | 2022-03-28T14:08:44.000Z | src/core/src/core_logic/PackageFilter.py | Azure/LinuxPatchExtension | 6af622afb4298805bdf47328d6bc66a785f7166b | [
"Apache-2.0"
] | 1 | 2020-12-28T10:13:20.000Z | 2020-12-28T10:13:20.000Z | # Copyright 2020 Microsoft Corporation
#
# 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... | 65.924855 | 216 | 0.728979 |
from core.src.bootstrap.Constants import Constants
import fnmatch
class PackageFilter(object):
def __init__(self, execution_config, composite_logger):
self.execution_config = execution_config
self.composite_logger = composite_logger
self.global_excluded_packages... | true | true |
f704c10fdcec8a9d3f12a9f1b47e921161913390 | 1,253 | py | Python | scripts/activate_amplifier.py | drocx/RPi-Jukebox-RFID | 1e211c2f4571a86d97747fe9094a34931de8b7c1 | [
"MIT"
] | 1 | 2020-03-24T20:27:07.000Z | 2020-03-24T20:27:07.000Z | scripts/activate_amplifier.py | drocx/RPi-Jukebox-RFID | 1e211c2f4571a86d97747fe9094a34931de8b7c1 | [
"MIT"
] | null | null | null | scripts/activate_amplifier.py | drocx/RPi-Jukebox-RFID | 1e211c2f4571a86d97747fe9094a34931de8b7c1 | [
"MIT"
] | 1 | 2019-10-06T16:33:52.000Z | 2019-10-06T16:33:52.000Z | #!/usr/bin/python3
import sys
from signal import pause
import RPi.GPIO as GPIO
# script to activate and deactivate an amplifier, power led, etc. using a GPIO
# pin on power up / down
# see for an example implementation with a PAM8403 digital amplifier
# (PAM pin 12 connected to GPIO 26)
# https://github.com/MiczFlor... | 26.659574 | 92 | 0.703113 |
import sys
from signal import pause
import RPi.GPIO as GPIO
AMP_GPIO = 26
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(AMP_GPIO, GPIO.OUT)
def set_amplifier(status):
if status:
print("Setting amplifier: ON")
GPIO.output(AMP_GPIO, GPIO.HIGH)
else:
print("S... | true | true |
f704c2d7e17f9fd856996531dcce0fe615f4d3e0 | 755 | py | Python | tests/create_config.py | throne/throne-cli | 5cc66165b858d9a22c65aac8269523ca1e89cbee | [
"BSD-3-Clause-Clear"
] | 4 | 2021-05-25T05:56:05.000Z | 2022-03-24T21:37:04.000Z | tests/create_config.py | throne/throne-cli | 5cc66165b858d9a22c65aac8269523ca1e89cbee | [
"BSD-3-Clause-Clear"
] | 9 | 2021-04-22T18:43:48.000Z | 2021-09-05T05:11:59.000Z | tests/create_config.py | throne/throne-cli | 5cc66165b858d9a22c65aac8269523ca1e89cbee | [
"BSD-3-Clause-Clear"
] | 1 | 2021-04-26T07:07:09.000Z | 2021-04-26T07:07:09.000Z | import os
import time
from click.testing import CliRunner
from bin.throne import cli as throne
runner = CliRunner()
shodan_key = os.getenv('SHODAN_KEY')
throne_user = os.getenv('THRONE_USER')
throne_pass = os.getenv('THRONE_PASS')
def test_throne_setapi():
print("Testing: throne api setapi")
response = runne... | 34.318182 | 103 | 0.717881 | import os
import time
from click.testing import CliRunner
from bin.throne import cli as throne
runner = CliRunner()
shodan_key = os.getenv('SHODAN_KEY')
throne_user = os.getenv('THRONE_USER')
throne_pass = os.getenv('THRONE_PASS')
def test_throne_setapi():
print("Testing: throne api setapi")
response = runne... | true | true |
f704c4328e33a065550916c30d7752a440d3bddf | 16,427 | py | Python | senlin-7.0.0/senlin/objects/fields.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | senlin-7.0.0/senlin/objects/fields.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | senlin-7.0.0/senlin/objects/fields.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | 30.647388 | 79 | 0.603397 |
from oslo_config import cfg
from oslo_serialization import jsonutils
from oslo_utils import strutils
from oslo_utils import uuidutils
from oslo_versionedobjects import fields
import re
import six
from senlin.common import consts
from senlin.common.i18n import _
CONF = cfg.CONF
FlexibleBooleanField = fi... | true | true |
f704c46b173fb645449a9542a94234ae033a96b3 | 5,712 | py | Python | view/__init__.py | sadlll/ablog | d04b532751c297fe9cd25563d08f48e8aaee7f48 | [
"Apache-2.0"
] | null | null | null | view/__init__.py | sadlll/ablog | d04b532751c297fe9cd25563d08f48e8aaee7f48 | [
"Apache-2.0"
] | null | null | null | view/__init__.py | sadlll/ablog | d04b532751c297fe9cd25563d08f48e8aaee7f48 | [
"Apache-2.0"
] | 1 | 2020-09-14T07:09:34.000Z | 2020-09-14T07:09:34.000Z | # coding:utf-8
import json
import random
import string
import tornado.web
import config
from lib.jsdict import JsDict
from model.user import User
# route
class Route(object):
urls = []
def __call__(self, url, name=None):
def _(cls):
self.urls.append(tornado.web.URLSpec(url, cls, name=nam... | 25.386667 | 107 | 0.605042 |
import json
import random
import string
import tornado.web
import config
from lib.jsdict import JsDict
from model.user import User
class Route(object):
urls = []
def __call__(self, url, name=None):
def _(cls):
self.urls.append(tornado.web.URLSpec(url, cls, name=name))
retur... | true | true |
f704c490c9753e311455f361ab6740be9fccc6f7 | 6,062 | py | Python | sdks/python/apache_beam/coders/standard_coders_test.py | bschell/beam | 5533acff51cf6157d62a63c60eb3f074f1958df5 | [
"Apache-2.0"
] | 1 | 2018-12-03T09:37:01.000Z | 2018-12-03T09:37:01.000Z | sdks/python/apache_beam/coders/standard_coders_test.py | bschell/beam | 5533acff51cf6157d62a63c60eb3f074f1958df5 | [
"Apache-2.0"
] | 2 | 2018-09-09T16:51:47.000Z | 2018-09-16T15:55:50.000Z | sdks/python/apache_beam/coders/standard_coders_test.py | bschell/beam | 5533acff51cf6157d62a63c60eb3f074f1958df5 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.8875 | 79 | 0.682118 |
from __future__ import absolute_import
from __future__ import print_function
import json
import logging
import os.path
import sys
import unittest
from builtins import map
import yaml
from apache_beam.coders import coder_impl
from apache_beam.coders import coders
from apache_beam.transforms import wi... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.