hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c13a9f35644a11795536d78e5b43704dfe8c7cd | 678 | py | Python | media/migrations/0001_initial.py | monginadiana/My-gallery | aa5f80e73491a27ea965ec5cffd4f2c91ae4c7e5 | [
"MIT"
] | null | null | null | media/migrations/0001_initial.py | monginadiana/My-gallery | aa5f80e73491a27ea965ec5cffd4f2c91ae4c7e5 | [
"MIT"
] | null | null | null | media/migrations/0001_initial.py | monginadiana/My-gallery | aa5f80e73491a27ea965ec5cffd4f2c91ae4c7e5 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-11-26 20:08
import cloudinary.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
(... | 27.12 | 117 | 0.59882 |
import cloudinary.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
('id', models.BigAutoField(auto_created=True, pri... | true | true |
1c13aa653e4265fbc7fa0b934dfc5fee649d00ed | 1,577 | py | Python | mediasoup-client/deps/webrtc/src/build/detect_host_arch.py | skgwazap/mediasoup-client-android | 474cffd75eeb3d25d515e7aca626a7e09180e99f | [
"MIT"
] | 128 | 2019-10-07T14:03:15.000Z | 2022-02-25T10:25:57.000Z | mediasoup-client/deps/webrtc/src/build/detect_host_arch.py | qq88797833/mediasoup-client-android | 474cffd75eeb3d25d515e7aca626a7e09180e99f | [
"MIT"
] | 51 | 2019-10-19T04:58:30.000Z | 2022-01-03T07:16:46.000Z | mediasoup-client/deps/webrtc/src/build/detect_host_arch.py | qq88797833/mediasoup-client-android | 474cffd75eeb3d25d515e7aca626a7e09180e99f | [
"MIT"
] | 90 | 2019-10-16T06:13:14.000Z | 2022-03-02T10:29:19.000Z | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Outputs host CPU architecture in format recognized by gyp."""
import platform
import re
import sys
def HostArch():
"""Returns t... | 29.203704 | 76 | 0.697527 |
"""Outputs host CPU architecture in format recognized by gyp."""
import platform
import re
import sys
def HostArch():
"""Returns the host architecture with a predictable string."""
host_arch = platform.machine()
if re.match(r'i.86', host_arch) or host_arch == 'i86pc':
host_arch = 'ia32'
elif host_arc... | false | true |
1c13aae54785a754420a0454122bfbdc25db587f | 13,624 | py | Python | acari.py | arcangelo7/Meta-Analyser-Tool | c6fc6bb1870a10efe39634687b388946dd8bb762 | [
"0BSD"
] | null | null | null | acari.py | arcangelo7/Meta-Analyser-Tool | c6fc6bb1870a10efe39634687b388946dd8bb762 | [
"0BSD"
] | null | null | null | acari.py | arcangelo7/Meta-Analyser-Tool | c6fc6bb1870a10efe39634687b388946dd8bb762 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Silvio Peroni <essepuntato@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
# and this permission notice appear in all copies.
#
# THE SOFTWARE I... | 42.842767 | 155 | 0.611641 |
import csv
from anytree import Node, search
import re
import networkx as nx
from collections import deque
from itertools import product, tee
def find_all_ids(cur_entity_ids, all_entity_ids):
for id in cur_entity_ids:
new_ids_set = set()
cur_ids_set = {id.strip() for id in id.split(";")}
... | true | true |
1c13ab5fa81f0fa6920f0d16048ca23e1d876302 | 7,974 | py | Python | vist_eval/cider/cider_scorer.py | lost-person/AREL | cee8bc542a2226f41fcbf65ed805fd585512689d | [
"MIT"
] | 17 | 2021-02-13T01:27:29.000Z | 2022-03-11T05:09:11.000Z | vist_eval/cider/cider_scorer.py | vivid-k/code | c39d5a0ba219b499e595812a31362a8f2535859e | [
"MIT"
] | 8 | 2021-02-13T01:50:19.000Z | 2022-03-14T12:56:25.000Z | vist_eval/cider/cider_scorer.py | vivid-k/code | c39d5a0ba219b499e595812a31362a8f2535859e | [
"MIT"
] | 2 | 2021-08-02T11:21:45.000Z | 2021-12-06T12:38:44.000Z | #!/usr/bin/env python
# Tsung-Yi Lin <tl483@cornell.edu>
# Ramakrishna Vedantam <vrama91@vt.edu>
import copy
from collections import defaultdict
import numpy as np
import pdb
import math
import pickle
import os
def precook(s, n=4, out=False):
"""
Takes a string as input and returns an object that can be give... | 38.897561 | 116 | 0.585277 |
import copy
from collections import defaultdict
import numpy as np
import pdb
import math
import pickle
import os
def precook(s, n=4, out=False):
words = s.split()
counts = defaultdict(int)
for k in range(1, n + 1):
for i in range(len(words) - k + 1):
ngram = tuple(words[i:i + k])
... | true | true |
1c13ab80ad9cca7136405d5420f546bdebae9ba4 | 2,388 | py | Python | tests/4attributes_test.py | ncgr/DSNormalizer | 016af547578594e8d2eb0988c7cf070c78796890 | [
"BSD-3-Clause"
] | null | null | null | tests/4attributes_test.py | ncgr/DSNormalizer | 016af547578594e8d2eb0988c7cf070c78796890 | [
"BSD-3-Clause"
] | 71 | 2020-04-13T17:14:01.000Z | 2021-08-02T11:33:37.000Z | tests/4attributes_test.py | ncgr/DSNormalizer | 016af547578594e8d2eb0988c7cf070c78796890 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# standard library imports
import json
# first-party imports
import sh
# module imports
from . import ANN_PATH
FASTA_NAME = "medtr.jemalong_A17.gnm5.FAKE.genome_main.fna"
GFF_PATH = "medtr.jemalong_A17.gnm5.ann1.FAKE.gene_models_main.gff3"
ORGANISM_DIR = str(ANN_PATH.parent)
UNREC_PATH = ANN_... | 36.738462 | 78 | 0.644891 | import json
import sh
from . import ANN_PATH
FASTA_NAME = "medtr.jemalong_A17.gnm5.FAKE.genome_main.fna"
GFF_PATH = "medtr.jemalong_A17.gnm5.ann1.FAKE.gene_models_main.gff3"
ORGANISM_DIR = str(ANN_PATH.parent)
UNREC_PATH = ANN_PATH / "medtr.jemalong_A17.gnm5.ann1.FAKE.badname.fna"
ANN_INVALID_LIST = [
(
... | true | true |
1c13abb7e7296fa62fb1334305181b875596c8ce | 4,519 | py | Python | message.py | olcansatir/Code-Tracking-Management-System | e9ebe6da2e2d20b919b41f93c9d3512e797b48e8 | [
"MIT"
] | null | null | null | message.py | olcansatir/Code-Tracking-Management-System | e9ebe6da2e2d20b919b41f93c9d3512e797b48e8 | [
"MIT"
] | null | null | null | message.py | olcansatir/Code-Tracking-Management-System | e9ebe6da2e2d20b919b41f93c9d3512e797b48e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 12 17:16:11 2021
@author: nedim
"""
from perceval.backends.core.git import Git
from perceval.backends.core.gitlab import GitLab
#from collections import Counter
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import argparse
import json
#dic_GIT... | 32.510791 | 126 | 0.575349 |
from perceval.backends.core.git import Git
from perceval.backends.core.gitlab import GitLab
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import argparse
import json
dic_GITLAB={}
dic_GIT={}
def extract_gitlab_identities():
pull_request_users=[]
issue_users=[]
repo=GitLab(... | true | true |
1c13aca3484c57dd87057c56f40a7bfa6c6bf5d7 | 1,389 | py | Python | benchmarks/test_pydantic.py | NoAnyLove/pydantic | 50fd2c5b48ffe611b5c4feb24f26f7202217faab | [
"MIT"
] | 1 | 2020-11-01T00:04:04.000Z | 2020-11-01T00:04:04.000Z | benchmarks/test_pydantic.py | NoAnyLove/pydantic | 50fd2c5b48ffe611b5c4feb24f26f7202217faab | [
"MIT"
] | null | null | null | benchmarks/test_pydantic.py | NoAnyLove/pydantic | 50fd2c5b48ffe611b5c4feb24f26f7202217faab | [
"MIT"
] | 1 | 2021-03-02T02:49:05.000Z | 2021-03-02T02:49:05.000Z | from datetime import datetime
from typing import List
from pydantic import BaseModel, Extra, PositiveInt, ValidationError, constr
class TestPydantic:
package = 'pydantic'
def __init__(self, allow_extra):
class Model(BaseModel):
id: int
client_name: constr(max_length=255)
... | 28.9375 | 75 | 0.570194 | from datetime import datetime
from typing import List
from pydantic import BaseModel, Extra, PositiveInt, ValidationError, constr
class TestPydantic:
package = 'pydantic'
def __init__(self, allow_extra):
class Model(BaseModel):
id: int
client_name: constr(max_length=255)
... | true | true |
1c13ace796381507807429799e2e3a1d7d7805cf | 3,396 | py | Python | aliyun-python-sdk-arms/aliyunsdkarms/request/v20190808/SearchTracesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-arms/aliyunsdkarms/request/v20190808/SearchTracesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-arms/aliyunsdkarms/request/v20190808/SearchTracesRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.12766 | 115 | 0.739694 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkarms.endpoint import endpoint_data
class SearchTracesRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'ARMS', '2019-08-08', 'SearchTraces','arms')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_... | true | true |
1c13ae1311a8eddba550ae48017ea6689489dc15 | 10,468 | py | Python | allink_core/core/loading.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 5 | 2017-03-13T08:49:45.000Z | 2022-03-05T20:05:56.000Z | allink_core/core/loading.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | 28 | 2019-10-21T08:32:18.000Z | 2022-02-10T13:16:38.000Z | allink_core/core/loading.py | allink/allink-core | cf2727f26192d8dee89d76feb262bc4760f36f5e | [
"BSD-3-Clause"
] | null | null | null | import sys
import traceback
from importlib import import_module
from django.apps import apps
from django.apps.config import MODELS_MODULE_NAME
from django.conf import settings
from django.core.exceptions import AppRegistryNotReady
from allink_core.core.exceptions import (AppNotFoundError, ClassNotFoundError, ModuleNo... | 41.539683 | 99 | 0.675201 | import sys
import traceback
from importlib import import_module
from django.apps import apps
from django.apps.config import MODELS_MODULE_NAME
from django.conf import settings
from django.core.exceptions import AppRegistryNotReady
from allink_core.core.exceptions import (AppNotFoundError, ClassNotFoundError, ModuleNo... | true | true |
1c13ae52d91f58ace01a114fea7faefc6ef6af55 | 2,835 | py | Python | sdk/servicebus/azure-servicebus/tests/stress_tests/stress_test_queue_slow_send_receive.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/servicebus/azure-servicebus/tests/stress_tests/stress_test_queue_slow_send_receive.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-04T18:12:16.000Z | 2019-06-04T18:12:16.000Z | sdk/servicebus/azure-servicebus/tests/stress_tests/stress_test_queue_slow_send_receive.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import time... | 35.4375 | 108 | 0.659965 |
import time
from datetime import datetime, timedelta
import concurrent
import conftest
from azure.servicebus import ServiceBusClient, Message
from azure.servicebus.common.constants import ReceiveSettleMode
def message_send_process(sb_config, queue, endtime):
client = ServiceBusClient(
service_namespace=... | true | true |
1c13afafb5256f28cd44050a05cff996f20c0f8f | 2,458 | py | Python | sdk/python/pulumi_azure_native/containerregistry/v20190401/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/containerregistry/v20190401/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/containerregistry/v20190401/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'Architecture',
'BaseImageTriggerType',
'OS',
'ResourceIdentityType',
'SecretObjectType',
'S... | 20.31405 | 118 | 0.631408 |
from enum import Enum
__all__ = [
'Architecture',
'BaseImageTriggerType',
'OS',
'ResourceIdentityType',
'SecretObjectType',
'SourceControlType',
'SourceRegistryLoginMode',
'SourceTriggerEvent',
'TaskStatus',
'TokenType',
'TriggerStatus',
'Variant',
]
class Architectur... | true | true |
1c13b02cb4c73350fa9685a4613ecbe64cbb0a26 | 8,197 | py | Python | geniepy/src/geniepy/pubmed.py | bytekoder/genie-1 | 71a4eb46c840fd6d30f9ad992d8a47a7eee985e1 | [
"MIT"
] | null | null | null | geniepy/src/geniepy/pubmed.py | bytekoder/genie-1 | 71a4eb46c840fd6d30f9ad992d8a47a7eee985e1 | [
"MIT"
] | null | null | null | geniepy/src/geniepy/pubmed.py | bytekoder/genie-1 | 71a4eb46c840fd6d30f9ad992d8a47a7eee985e1 | [
"MIT"
] | null | null | null | """PubMed related functionality."""
import xml.etree.ElementTree as ET
import json
import csv
import jsonlines
class PubMedArticle:
"""
PubMed Article model.
Reference documentation:
https: // www.nlm.nih.gov/bsd/licensee/elements_descriptions.html
"""
MEDLINE_TAG = "MedlineCitation"
ART... | 34.441176 | 88 | 0.613151 | import xml.etree.ElementTree as ET
import json
import csv
import jsonlines
class PubMedArticle:
MEDLINE_TAG = "MedlineCitation"
ARTICLE_TAG = MEDLINE_TAG + "/Article"
JOURNAL_TAG = ARTICLE_TAG + "/Journal"
__slots__ = ["_pubmed_article"]
def __init__(self, article_tree: ET.Element):
sel... | true | true |
1c13b1652541a7cf45f420ce9ba9f51dca6cf34c | 32,608 | py | Python | Validation/RecoTrack/python/SiStripTrackingRecHitsValid_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Validation/RecoTrack/python/SiStripTrackingRecHitsValid_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Validation/RecoTrack/python/SiStripTrackingRecHitsValid_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
StripTrackingRecHitsValid = DQMEDAnalyzer('SiStripTrackingRecHitsValid',
outputFile = cms.string('striptrackingrechitshisto.root'),
runStandalone = cms.bool(False),
OutputMEsInRootFile = cms.bool(False),
T... | 32.413519 | 76 | 0.468719 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
StripTrackingRecHitsValid = DQMEDAnalyzer('SiStripTrackingRecHitsValid',
outputFile = cms.string('striptrackingrechitshisto.root'),
runStandalone = cms.bool(False),
OutputMEsInRootFile = cms.bool(False),
T... | true | true |
1c13b1c65e644112cea7dd358e7f6be8c2f588a3 | 2,188 | py | Python | tests/ui_tests/app/page/host_list/locators.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | tests/ui_tests/app/page/host_list/locators.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | tests/ui_tests/app/page/host_list/locators.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | # 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 under t... | 47.565217 | 120 | 0.655393 |
from selenium.webdriver.common.by import By
from tests.ui_tests.app.helpers.locator import (
Locator,
TemplateLocator,
)
from tests.ui_tests.app.page.common.table.locator import CommonTable
class HostListLocators:
class Tooltip:
apps_btn = Locator(By.XPATH, "//a[.//mat-icon[text()='apps']]", "... | true | true |
1c13b27f58ba23fe66ef30e32530c6c5502825c8 | 11,245 | py | Python | nasbench/lib/evaluate.py | chrisying/nasbench | c51c65b90cb5ef571a8d5b5af2aff893b92863d8 | [
"Apache-2.0"
] | null | null | null | nasbench/lib/evaluate.py | chrisying/nasbench | c51c65b90cb5ef571a8d5b5af2aff893b92863d8 | [
"Apache-2.0"
] | null | null | null | nasbench/lib/evaluate.py | chrisying/nasbench | c51c65b90cb5ef571a8d5b5af2aff893b92863d8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 35.926518 | 80 | 0.694442 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
from nasbench.lib import cifar
from nasbench.lib import model_builder
from nasbench.lib import training_time
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
VALID_E... | true | true |
1c13b3e3f9ce37cbcb110daa72581c0951d0d166 | 1,653 | py | Python | Regularization./code.py | arshee2403/ga-learner-dsmp-repo | f79d26ceaf38952e975404984f7d14d585727c15 | [
"MIT"
] | 2 | 2019-10-12T16:05:04.000Z | 2020-01-22T16:41:58.000Z | Regularization./code.py | arshee2403/ga-learner-dsmp-repo | f79d26ceaf38952e975404984f7d14d585727c15 | [
"MIT"
] | null | null | null | Regularization./code.py | arshee2403/ga-learner-dsmp-repo | f79d26ceaf38952e975404984f7d14d585727c15 | [
"MIT"
] | null | null | null | # --------------
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
# path- variable storing file path
#Code starts here
df = pd.read_csv(path)
print(df.head(5))
X = df.drop('Price',axis=1)
y = df['Price']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_si... | 21.192308 | 87 | 0.716878 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
df = pd.read_csv(path)
print(df.head(5))
X = df.drop('Price',axis=1)
y = df['Price']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.3,random_state = 6)
corr = X_train.corr()
print(corr)
from sk... | true | true |
1c13b4f6e828829d3566f659a6db9bf81e7ce1aa | 268 | py | Python | student_portal_crawler/parser/__init__.py | StudioAquatan/student_portal_crawler | b3cfda41451fa7f0c08f4d50f2e8264bf9363a79 | [
"MIT"
] | null | null | null | student_portal_crawler/parser/__init__.py | StudioAquatan/student_portal_crawler | b3cfda41451fa7f0c08f4d50f2e8264bf9363a79 | [
"MIT"
] | 17 | 2018-03-10T12:40:38.000Z | 2018-03-22T09:26:27.000Z | student_portal_crawler/parser/__init__.py | StudioAquatan/student_portal_crawler | b3cfda41451fa7f0c08f4d50f2e8264bf9363a79 | [
"MIT"
] | null | null | null | from .base import BaseParser, GeneralParser, REGISTERED_PARSERS
from .static import SupportedPages
from .utils import norm, get_key_from_url
from .lec_info import LectureInformationParser
from .lec_cancel import LectureCancellationParser
from .news import NewsParser
| 33.5 | 63 | 0.86194 | from .base import BaseParser, GeneralParser, REGISTERED_PARSERS
from .static import SupportedPages
from .utils import norm, get_key_from_url
from .lec_info import LectureInformationParser
from .lec_cancel import LectureCancellationParser
from .news import NewsParser
| true | true |
1c13b5d450716c5e9557b087847fe2c56e2ad8a3 | 2,950 | py | Python | src/flor-0.0.0-alpha/flor/object_model/literal.py | ucbrise/flor-camp2018 | a0b48bb2c058fb07dca1f6ac7ce2e34941146282 | [
"Apache-2.0"
] | 1 | 2019-04-24T05:02:06.000Z | 2019-04-24T05:02:06.000Z | src/flor-0.0.0-alpha/flor/object_model/literal.py | ucbrise/flor-camp2018 | a0b48bb2c058fb07dca1f6ac7ce2e34941146282 | [
"Apache-2.0"
] | null | null | null | src/flor-0.0.0-alpha/flor/object_model/literal.py | ucbrise/flor-camp2018 | a0b48bb2c058fb07dca1f6ac7ce2e34941146282 | [
"Apache-2.0"
] | 2 | 2019-08-09T20:31:00.000Z | 2021-08-04T02:34:26.000Z | #!/usr/bin/env python3
from flor import util
from flor.shared_object_model.resource import Resource
from uuid import uuid4
class Literal(Resource):
#TODO: Add support for non-primitive values such as DataFrames
def __init__(self, v,
name: str,
parent,
xp_... | 29.207921 | 91 | 0.594915 |
from flor import util
from flor.shared_object_model.resource import Resource
from uuid import uuid4
class Literal(Resource):
def __init__(self, v,
name: str,
parent,
xp_state,
default,
version):
super().__init__(... | true | true |
1c13b70972dc7cb0a87fc06c347891181049b339 | 2,491 | py | Python | Python/graphs/Hamiltonian_Path.py | zhcet19/NeoAlgo-1 | c534a23307109280bda0e4867d6e8e490002a4ee | [
"MIT"
] | 897 | 2020-06-25T00:12:52.000Z | 2022-03-24T00:49:31.000Z | Python/graphs/Hamiltonian_Path.py | zhcet19/NeoAlgo-1 | c534a23307109280bda0e4867d6e8e490002a4ee | [
"MIT"
] | 5,707 | 2020-06-24T17:53:28.000Z | 2022-01-22T05:03:15.000Z | Python/graphs/Hamiltonian_Path.py | zhcet19/NeoAlgo-1 | c534a23307109280bda0e4867d6e8e490002a4ee | [
"MIT"
] | 1,817 | 2020-06-25T03:51:05.000Z | 2022-03-29T05:14:07.000Z | """
Hamiltonian Path: a Hamiltonian path (or traceable path) is a path
in an undirected or directed graph that visits each vertex exactly
once.
Problem Link: https://en.wikipedia.org/wiki/Hamiltonian_path
Purpose: To determine the existance of a Hamiltonian Path in the provided
undirected graph and ret... | 21.850877 | 76 | 0.575672 | from collections import defaultdict
def DFS(n, graph, pos, ans):
if pos == n:
return ans
current = ans[-1]
for i in graph[current]:
if i not in ans:
ans += [i]
temp = DFS(n, graph, pos + 1, ans)
if temp:
return temp
... | true | true |
1c13b74775bcbbf29da154cb3e72ed74440e7435 | 385 | py | Python | src/note/migrations/0004_note_title.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/note/migrations/0004_note_title.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/note/migrations/0004_note_title.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | # Generated by Django 2.2 on 2021-08-27 16:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('note', '0003_auto_20210824_0043'),
]
operations = [
migrations.AddField(
model_name='note',
name='title',
... | 20.263158 | 59 | 0.587013 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('note', '0003_auto_20210824_0043'),
]
operations = [
migrations.AddField(
model_name='note',
name='title',
field=models.TextField(blank=True, default='')... | true | true |
1c13b776e4c6e10b6e147a70b6efa089eea00005 | 14,361 | py | Python | superset/connectors/druid/views.py | LFischerstrom/incubator-superset | 47f42ed351964230c77611b215466eea115e6456 | [
"Apache-2.0"
] | 1 | 2019-01-11T12:54:42.000Z | 2019-01-11T12:54:42.000Z | superset/connectors/druid/views.py | LFischerstrom/incubator-superset | 47f42ed351964230c77611b215466eea115e6456 | [
"Apache-2.0"
] | 24 | 2018-10-12T08:42:46.000Z | 2019-03-04T06:40:56.000Z | superset/connectors/druid/views.py | g4brielvs/incubator-superset | 83ee9178328c5193808fe356ceb3090a299477f6 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.792105 | 90 | 0.640067 | from datetime import datetime
import json
import logging
from flask import flash, Markup, redirect
from flask_appbuilder import CompactCRUDMixin, expose
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_appbuilder.security.decorators import has_access
from flask_babel import gettext as __
fro... | true | true |
1c13b800398ef89d91325654ed2fdcfbdea38a6f | 1,482 | py | Python | data/lib/qtUtils/QColorButton.py | Synell/PERT-Maker | 8eac93eaa788ee0a201437e5bd30d55133d7cd38 | [
"MIT"
] | null | null | null | data/lib/qtUtils/QColorButton.py | Synell/PERT-Maker | 8eac93eaa788ee0a201437e5bd30d55133d7cd38 | [
"MIT"
] | null | null | null | data/lib/qtUtils/QColorButton.py | Synell/PERT-Maker | 8eac93eaa788ee0a201437e5bd30d55133d7cd38 | [
"MIT"
] | null | null | null | #----------------------------------------------------------------------
# Libraries
from PyQt6.QtWidgets import QPushButton, QColorDialog
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QPixmap, QIcon, QColor, QImage
#----------------------------------------------------------------------
# Class
... | 34.465116 | 113 | 0.520918 |
from PyQt6.QtWidgets import QPushButton, QColorDialog
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QPixmap, QIcon, QColor, QImage
class QColorButton(QPushButton):
def __init__(self, buttonText: str = '', colorPickerLangData: dict = {}, color: QColor = QColor('#ffffff')):
super().__in... | true | true |
1c13b82ea8ef5c365dadc7d3727725dad7bec97c | 1,157 | py | Python | tvm/tests/python/unittest/test_pass_equal.py | hj424/heterocl | e51b8f7f65ae6ad55c0c2426ab7192c3d8f6702b | [
"Apache-2.0"
] | 64 | 2021-05-02T14:42:34.000Z | 2021-05-06T01:35:03.000Z | tvm/tests/python/unittest/test_pass_equal.py | hj424/heterocl | e51b8f7f65ae6ad55c0c2426ab7192c3d8f6702b | [
"Apache-2.0"
] | 23 | 2019-07-29T05:21:52.000Z | 2020-08-31T18:51:42.000Z | tvm/tests/python/unittest/test_pass_equal.py | hj424/heterocl | e51b8f7f65ae6ad55c0c2426ab7192c3d8f6702b | [
"Apache-2.0"
] | 51 | 2019-07-12T05:10:25.000Z | 2021-07-28T16:19:06.000Z | import tvm
def test_equal_expr():
x = tvm.var('x')
y = tvm.var('y')
def func1():
return x + y + 1
def func2():
return tvm.exp((x + y + 1) * y / 4)
assert tvm.ir_pass.Equal(func1(), func1())
assert tvm.ir_pass.Equal(func2(), func2())
assert not tvm.ir_pass.Equal(func2(), f... | 23.612245 | 52 | 0.516854 | import tvm
def test_equal_expr():
x = tvm.var('x')
y = tvm.var('y')
def func1():
return x + y + 1
def func2():
return tvm.exp((x + y + 1) * y / 4)
assert tvm.ir_pass.Equal(func1(), func1())
assert tvm.ir_pass.Equal(func2(), func2())
assert not tvm.ir_pass.Equal(func2(), f... | true | true |
1c13b8c0593e7831048e2bda509666ab1de79c69 | 44 | py | Python | iautil/utilities/__init__.py | henryjsmith12/image-analysis-util | 4c0d6108c9e726b2232690aadd6eed021b4934e0 | [
"CNRI-Python",
"Xnet",
"X11"
] | 1 | 2021-12-25T05:26:13.000Z | 2021-12-25T05:26:13.000Z | iautil/utilities/__init__.py | henryjsmith12/image-analysis-util | 4c0d6108c9e726b2232690aadd6eed021b4934e0 | [
"CNRI-Python",
"Xnet",
"X11"
] | null | null | null | iautil/utilities/__init__.py | henryjsmith12/image-analysis-util | 4c0d6108c9e726b2232690aadd6eed021b4934e0 | [
"CNRI-Python",
"Xnet",
"X11"
] | null | null | null | """
Miscellaneous classes and functions.
""" | 14.666667 | 36 | 0.727273 | true | true | |
1c13b8c53befd4f8b1de0e21be38ef4de45c6917 | 612 | py | Python | app/application/assets.py | nickeita/su2021_is601_project4 | 6c3f733abc4c0a4b8983d95a79ca403a6da658e2 | [
"MIT"
] | null | null | null | app/application/assets.py | nickeita/su2021_is601_project4 | 6c3f733abc4c0a4b8983d95a79ca403a6da658e2 | [
"MIT"
] | null | null | null | app/application/assets.py | nickeita/su2021_is601_project4 | 6c3f733abc4c0a4b8983d95a79ca403a6da658e2 | [
"MIT"
] | null | null | null | from flask import current_app as app
from flask_assets import Bundle
def compile_static_assets(assets):
# Home asset bundles
home_style_bundle = Bundle('src/less/*.less', filters='less,cssmin', output='dist/css/style.min.css',
extra={'rel': 'stylesheet/css'})
home_js_bundle... | 34 | 105 | 0.676471 | from flask import current_app as app
from flask_assets import Bundle
def compile_static_assets(assets):
home_style_bundle = Bundle('src/less/*.less', filters='less,cssmin', output='dist/css/style.min.css',
extra={'rel': 'stylesheet/css'})
home_js_bundle = Bundle('src/js/hom... | true | true |
1c13b916458853e1ab1dd770a17f06be0c3611ba | 969 | py | Python | test/test_tag_i_ds.py | LayeredInsight/layint_scan_api_python | bc258b2af5d2211b986e32fedea95fcfc7de80ff | [
"Apache-2.0"
] | 1 | 2018-03-26T23:55:00.000Z | 2018-03-26T23:55:00.000Z | test/test_tag_i_ds.py | LayeredInsight/layint_scan_api_python | bc258b2af5d2211b986e32fedea95fcfc7de80ff | [
"Apache-2.0"
] | null | null | null | test/test_tag_i_ds.py | LayeredInsight/layint_scan_api_python | bc258b2af5d2211b986e32fedea95fcfc7de80ff | [
"Apache-2.0"
] | 2 | 2020-11-04T02:56:33.000Z | 2020-11-05T08:12:01.000Z | # coding: utf-8
"""
Layered Insight Scan
Layered Insight Scan performs static vulnerability analysis, license and package compliance. You can find out more about Scan at http://layeredinsight.com.
OpenAPI spec version: 0.9.4
Contact: help@layeredinsight.com
Generated by: https://github.com/swagg... | 21.533333 | 160 | 0.698658 |
from __future__ import absolute_import
import os
import sys
import unittest
import layint_scan_api
from layint_scan_api.rest import ApiException
from layint_scan_api.models.tag_i_ds import TagIDs
class TestTagIDs(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
de... | true | true |
1c13b92f9d3879bd9ba757a965d72d7ea22b1d6b | 139 | py | Python | BOT_TOKEN.py | CaptainVietnam6/MonarchBot | 1c1ca4d9e5fd070555b8627f7ace715bfadbdac4 | [
"Apache-2.0"
] | null | null | null | BOT_TOKEN.py | CaptainVietnam6/MonarchBot | 1c1ca4d9e5fd070555b8627f7ace715bfadbdac4 | [
"Apache-2.0"
] | null | null | null | BOT_TOKEN.py | CaptainVietnam6/MonarchBot | 1c1ca4d9e5fd070555b8627f7ace715bfadbdac4 | [
"Apache-2.0"
] | null | null | null | #this is the bot token and will be required for the IDE to connect with discord's API
import os
BOT_TOKEN = os.environ["BOT_TOKEN_SECRET"]
| 34.75 | 85 | 0.784173 | import os
BOT_TOKEN = os.environ["BOT_TOKEN_SECRET"]
| true | true |
1c13b9597ce1506eebe845a46343b259f4f13b0b | 8,343 | py | Python | tools/train.py | tuanho27/OpenPCDet | facde3cdb9590f238cfbfac88633e2746dcad2a4 | [
"Apache-2.0"
] | null | null | null | tools/train.py | tuanho27/OpenPCDet | facde3cdb9590f238cfbfac88633e2746dcad2a4 | [
"Apache-2.0"
] | null | null | null | tools/train.py | tuanho27/OpenPCDet | facde3cdb9590f238cfbfac88633e2746dcad2a4 | [
"Apache-2.0"
] | null | null | null | import os
import torch
import torch.nn as nn
from tensorboardX import SummaryWriter
from pcdet.config import cfg, log_config_to_file, cfg_from_list, cfg_from_yaml_file
from pcdet.utils import common_utils
from pcdet.datasets import build_dataloader
from pcdet.models import build_network, model_fn_decorator
from train_u... | 44.37766 | 118 | 0.671102 | import os
import torch
import torch.nn as nn
from tensorboardX import SummaryWriter
from pcdet.config import cfg, log_config_to_file, cfg_from_list, cfg_from_yaml_file
from pcdet.utils import common_utils
from pcdet.datasets import build_dataloader
from pcdet.models import build_network, model_fn_decorator
from train_u... | true | true |
1c13b96b892e8bef724e7ab1dac328bdd3c2cedf | 211 | py | Python | initialize_db.py | ethan-nelson/osmhm_run | 7a5196dde07934bc9d740e9d3221155cd33b0574 | [
"MIT"
] | 4 | 2015-11-14T04:36:47.000Z | 2018-03-21T22:46:35.000Z | initialize_db.py | ethan-nelson/osmhm_run | 7a5196dde07934bc9d740e9d3221155cd33b0574 | [
"MIT"
] | 12 | 2015-11-11T18:23:50.000Z | 2022-02-06T16:26:13.000Z | initialize_db.py | ethan-nelson/osmhm_run | 7a5196dde07934bc9d740e9d3221155cd33b0574 | [
"MIT"
] | 2 | 2018-05-27T16:29:53.000Z | 2020-05-05T20:36:25.000Z | import os
import osmhm_site
import sqlalchemy
engine = sqlalchemy.create_engine(os.environ['DATABASE_URL'])
osmhm_site.models.DBSession.configure(bind=engine)
osmhm_site.models.Base.metadata.create_all(engine)
| 26.375 | 61 | 0.843602 | import os
import osmhm_site
import sqlalchemy
engine = sqlalchemy.create_engine(os.environ['DATABASE_URL'])
osmhm_site.models.DBSession.configure(bind=engine)
osmhm_site.models.Base.metadata.create_all(engine)
| true | true |
1c13b9bb3907374adb9b4a948df3ce7f777c027b | 493 | py | Python | plotly/validators/histogram/marker/colorbar/_outlinewidth.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/histogram/marker/colorbar/_outlinewidth.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/histogram/marker/colorbar/_outlinewidth.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class OutlinewidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='outlinewidth',
parent_name='histogram.marker.colorbar',
**kwargs
):
super(OutlinewidthValidator, self).__init__(
... | 24.65 | 74 | 0.604462 | import _plotly_utils.basevalidators
class OutlinewidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='outlinewidth',
parent_name='histogram.marker.colorbar',
**kwargs
):
super(OutlinewidthValidator, self).__init__(
... | true | true |
1c13b9cc47e3580d04e914eca7b81f8ea57dc06f | 3,703 | py | Python | huaweicloud-sdk-dgc/huaweicloudsdkdgc/v1/model/restore_job_instance_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-dgc/huaweicloudsdkdgc/v1/model/restore_job_instance_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-dgc/huaweicloudsdkdgc/v1/model/restore_job_instance_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RestoreJobInstanceRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): ... | 26.45 | 79 | 0.566298 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RestoreJobInstanceRequest:
sensitive_list = []
openapi_types = {
'job_name': 'str',
'instance_id': 'str'
}
attribute_map = {
'job_name': 'job_name',
'instance_... | true | true |
1c13b9e8a1b3267161665d52e85380f7167bf9ff | 408 | py | Python | notebooks/notebook_solutions/extract_product_id.py | kmbrou/text-mining-class | 06160dfed64c5d2485d18c0c9dc719efe74a5521 | [
"MIT"
] | 43 | 2018-10-22T05:14:32.000Z | 2020-11-19T19:05:08.000Z | notebooks/notebook_solutions/extract_product_id.py | kmbrou/text-mining-class | 06160dfed64c5d2485d18c0c9dc719efe74a5521 | [
"MIT"
] | 1 | 2018-11-27T18:01:30.000Z | 2018-11-27T18:01:30.000Z | notebooks/notebook_solutions/extract_product_id.py | kmbrou/text-mining-class | 06160dfed64c5d2485d18c0c9dc719efe74a5521 | [
"MIT"
] | 25 | 2018-11-27T17:09:19.000Z | 2020-11-19T19:05:29.000Z | def extract_product_id(book_card):
link_urls = [tag.get_attribute("href")
for tag in book_card.find_elements_by_tag_name("a")]
product_urls = set(url for url in link_urls if "/product/" in url)
assert len(product_urls) == 1
url = next(iter(product_urls))
components = url.split("/")
... | 34 | 70 | 0.688725 | def extract_product_id(book_card):
link_urls = [tag.get_attribute("href")
for tag in book_card.find_elements_by_tag_name("a")]
product_urls = set(url for url in link_urls if "/product/" in url)
assert len(product_urls) == 1
url = next(iter(product_urls))
components = url.split("/")
... | true | true |
1c13ba6d393add58f411914975404637ab1fcff5 | 446 | py | Python | examples/circular/servB.py | gabehack/Pyro4 | 88f88bf1ccdfaff8c2bbbda8fc032a145d07d44b | [
"MIT"
] | null | null | null | examples/circular/servB.py | gabehack/Pyro4 | 88f88bf1ccdfaff8c2bbbda8fc032a145d07d44b | [
"MIT"
] | null | null | null | examples/circular/servB.py | gabehack/Pyro4 | 88f88bf1ccdfaff8c2bbbda8fc032a145d07d44b | [
"MIT"
] | null | null | null | from __future__ import print_function
import Pyro4
import chain
this_node = "B"
next_node = "C"
servername = "example.chain." + this_node
with Pyro4.core.Daemon() as daemon:
obj = chain.Chain(this_node, next_node)
uri = daemon.register(obj)
with Pyro4.naming.locateNS() as ns:
ns.regi... | 23.473684 | 44 | 0.670404 | from __future__ import print_function
import Pyro4
import chain
this_node = "B"
next_node = "C"
servername = "example.chain." + this_node
with Pyro4.core.Daemon() as daemon:
obj = chain.Chain(this_node, next_node)
uri = daemon.register(obj)
with Pyro4.naming.locateNS() as ns:
ns.regi... | true | true |
1c13bac71abff0dae2e779a588f9909b410d473c | 7,254 | py | Python | alipay/aop/api/domain/CmItemSkuInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/CmItemSkuInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/CmItemSkuInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.MaterialInfo import MaterialInfo
from alipay.aop.api.domain.ItemSkuPropertyInfo import ItemSkuPropertyInfo
class CmItemSkuInfo(object):
def __init__(self):
self._gmt_... | 33.739535 | 91 | 0.586711 | import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.MaterialInfo import MaterialInfo
from alipay.aop.api.domain.ItemSkuPropertyInfo import ItemSkuPropertyInfo
class CmItemSkuInfo(object):
def __init__(self):
self._gmt_create = None
self._gmt_modified = Non... | true | true |
1c13bbcc97f171b9bce1f2555ecf2ac825c740c0 | 2,175 | py | Python | lib/galaxy/jobs/metrics/instrumenters/meminfo.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/jobs/metrics/instrumenters/meminfo.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/jobs/metrics/instrumenters/meminfo.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | null | null | null | """The module describes the ``meminfo`` job metrics plugin."""
import re
import sys
from galaxy import util
from ..instrumenters import InstrumentPlugin
from ...metrics import formatting
if sys.version_info > (3,):
long = int
MEMINFO_LINE = re.compile(r"(\w+)\s*\:\s*(\d+) kB")
# Important (non-verbose) meminf... | 32.954545 | 91 | 0.623908 | import re
import sys
from galaxy import util
from ..instrumenters import InstrumentPlugin
from ...metrics import formatting
if sys.version_info > (3,):
long = int
MEMINFO_LINE = re.compile(r"(\w+)\s*\:\s*(\d+) kB")
MEMINFO_TITLES = {
"memtotal": "Total System Memory",
"swaptotal": "Total System Swap"
... | true | true |
1c13bd47deb35417d9091392e1b35522c4960dcc | 1,134 | py | Python | website_git/comments/models.py | hanumanthareddy/website | cf9ff49fe352141b1be8a12bb8a935d2d29c0a23 | [
"MIT"
] | null | null | null | website_git/comments/models.py | hanumanthareddy/website | cf9ff49fe352141b1be8a12bb8a935d2d29c0a23 | [
"MIT"
] | 6 | 2019-12-04T23:04:42.000Z | 2021-06-09T17:50:15.000Z | website_git/comments/models.py | hanumanthareddy/website | cf9ff49fe352141b1be8a12bb8a935d2d29c0a23 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
# Create your models here.
class CommentManager(models.Manager):
... | 37.8 | 96 | 0.738977 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
class CommentManager(models.Manager):
def filter_by_instance(self, instance):
co... | true | true |
1c13bdd5a436eebbe65ab093032e4b3b2b4905cf | 2,559 | py | Python | python/foglamp/services/common/service_announcer.py | kayanme/FogLAMP | 909b5adf558ea9c4e217d11de2a815ecdbf7bb6d | [
"Apache-2.0"
] | 65 | 2017-05-15T21:55:04.000Z | 2022-01-19T01:30:42.000Z | python/foglamp/services/common/service_announcer.py | kayanme/FogLAMP | 909b5adf558ea9c4e217d11de2a815ecdbf7bb6d | [
"Apache-2.0"
] | 576 | 2017-05-22T05:41:07.000Z | 2020-02-13T07:48:58.000Z | python/foglamp/services/common/service_announcer.py | kayanme/FogLAMP | 909b5adf558ea9c4e217d11de2a815ecdbf7bb6d | [
"Apache-2.0"
] | 52 | 2017-05-09T22:45:47.000Z | 2022-03-10T18:49:02.000Z | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
"""Common FoglampMicroservice Class"""
import socket
from zeroconf import ServiceInfo, ServiceBrowser, ServiceStateChange, Zeroconf
from foglamp.common import logger
__author__ = "Mark Riddoch, Amarendra K Sinha"
__copyri... | 33.671053 | 130 | 0.599844 |
import socket
from zeroconf import ServiceInfo, ServiceBrowser, ServiceStateChange, Zeroconf
from foglamp.common import logger
__author__ = "Mark Riddoch, Amarendra K Sinha"
__copyright__ = "Copyright (c) 2017 OSIsoft, LLC"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"
_LOGGER = logger.setup(__name__)
... | true | true |
1c13be5fd8ddab6a118c040e94ec820371028058 | 258 | py | Python | invenio_requests/services/__init__.py | fenekku/invenio-requests | 132451d9ac99e63512fb4920003f5eff42b115c7 | [
"MIT"
] | null | null | null | invenio_requests/services/__init__.py | fenekku/invenio-requests | 132451d9ac99e63512fb4920003f5eff42b115c7 | [
"MIT"
] | null | null | null | invenio_requests/services/__init__.py | fenekku/invenio-requests | 132451d9ac99e63512fb4920003f5eff42b115c7 | [
"MIT"
] | null | null | null | from .config import RequestCommentsServiceConfig, RequestsServiceConfig
from .services import RequestCommentsService, RequestsService
__all__ = [
'RequestsService', 'RequestCommentsService', 'RequestsServiceConfig',
'RequestCommentsServiceConfig'
]
| 32.25 | 73 | 0.825581 | from .config import RequestCommentsServiceConfig, RequestsServiceConfig
from .services import RequestCommentsService, RequestsService
__all__ = [
'RequestsService', 'RequestCommentsService', 'RequestsServiceConfig',
'RequestCommentsServiceConfig'
]
| true | true |
1c13bf3667055d632f33d6d5014034bc4995d86e | 2,996 | py | Python | text_generation/models/gpt2_lm.py | daniilgaltsev/text-generation-disco-elysium | ca32e52af047574c70c4bce8fc409b34bd7f5111 | [
"MIT"
] | 2 | 2021-02-24T10:33:50.000Z | 2021-04-16T06:29:05.000Z | text_generation/models/gpt2_lm.py | daniilgaltsev/text-generation-disco-elysium | ca32e52af047574c70c4bce8fc409b34bd7f5111 | [
"MIT"
] | null | null | null | text_generation/models/gpt2_lm.py | daniilgaltsev/text-generation-disco-elysium | ca32e52af047574c70c4bce8fc409b34bd7f5111 | [
"MIT"
] | null | null | null | from typing import List, Dict, Any
import torch
import transformers
class GPT2LMHeadModel(torch.nn.Module):
"""
Loads and contains gpt2 model with language modelling head.
Args:
tokenizer: A tokenizer to use for encoding given sequences.
weights_path (optional): A path to the pre-trained ... | 31.87234 | 103 | 0.60781 | from typing import List, Dict, Any
import torch
import transformers
class GPT2LMHeadModel(torch.nn.Module):
def __init__(
self,
tokenizer: transformers.PreTrainedTokenizerBase,
weights_path: str = "gpt2",
):
super().__init__()
self.tokenizer = tokenizer
self.m... | true | true |
1c13bf3be68c98660b937eada5aec8bdef502e95 | 15,114 | py | Python | sec_groups/pairing.py | toonsegers/sec_groups | 32541f8e365b8ed280133c5f88aafb09c5eb2790 | [
"MIT"
] | 3 | 2021-07-21T10:15:46.000Z | 2022-01-06T02:12:05.000Z | sec_groups/pairing.py | toonsegers/sec_groups | 32541f8e365b8ed280133c5f88aafb09c5eb2790 | [
"MIT"
] | null | null | null | sec_groups/pairing.py | toonsegers/sec_groups | 32541f8e365b8ed280133c5f88aafb09c5eb2790 | [
"MIT"
] | null | null | null | """ Adaptation of work by Jack Lloyd:
https://github.com/randombit/pairings.py/
Original code under BSD-2-Clause license:
https://github.com/randombit/pairings.py/blob/master/LICENSE.md
----------------------------------------------------------------------
Copyright and license information of the original work... | 23.252308 | 86 | 0.475255 | import copy
from sec_groups.ellcurves import BN256, BN256_TWIST
GFp_1 = BN256.field
GFp_2 = BN256_TWIST.field
v = 1868033
u = pow(v, 3)
p = 36 * u ** 4 + 36 * u ** 3 + 24 * u ** 2 + 6 * u + 1
i = GFp_2([0, 1, 0])
xi = i + GFp_2([3, 0, 0])
xi1 = [
xi ** (1 * (p - 1) // 6),
xi ** (2 * (p - ... | true | true |
1c13bf44ac05a7b4b9deb4333ff0bf66268f7385 | 4,976 | py | Python | src/scene_vis/vtk_wrapper/vtk_frustums.py | salarim/scene_vis | 8e146195599aaa7598137dd223e9ce2b9e0b25a3 | [
"MIT"
] | 33 | 2019-07-16T19:52:43.000Z | 2022-03-17T15:30:59.000Z | src/scene_vis/vtk_wrapper/vtk_frustums.py | salarim/scene_vis | 8e146195599aaa7598137dd223e9ce2b9e0b25a3 | [
"MIT"
] | null | null | null | src/scene_vis/vtk_wrapper/vtk_frustums.py | salarim/scene_vis | 8e146195599aaa7598137dd223e9ce2b9e0b25a3 | [
"MIT"
] | 10 | 2021-12-25T06:36:18.000Z | 2022-03-15T11:25:00.000Z | """https://github.com/kujason/scene_vis"""
import numpy as np
import vtk
class VtkFrustums:
"""Frustums
"""
def __init__(self):
# VTK Data
self.vtk_poly_data = vtk.vtkPolyData()
self.vtk_points = vtk.vtkPoints()
self.vtk_cells = vtk.vtkCellArray()
self.vtk_poly_... | 35.798561 | 76 | 0.614751 |
import numpy as np
import vtk
class VtkFrustums:
def __init__(self):
self.vtk_poly_data = vtk.vtkPolyData()
self.vtk_points = vtk.vtkPoints()
self.vtk_cells = vtk.vtkCellArray()
self.vtk_poly_data.SetPoints(self.vtk_points)
self.vtk_poly_data.SetVerts(self.vtk_c... | true | true |
1c13c0aa28e2bb099db0cdb847686a549662a175 | 10,292 | py | Python | examples/seq2seq/utils.py | mingyingyu/transformers | 1045f7b45d31c62af595e4d53b4a37cbaf5687b9 | [
"Apache-2.0"
] | null | null | null | examples/seq2seq/utils.py | mingyingyu/transformers | 1045f7b45d31c62af595e4d53b4a37cbaf5687b9 | [
"Apache-2.0"
] | null | null | null | examples/seq2seq/utils.py | mingyingyu/transformers | 1045f7b45d31c62af595e4d53b4a37cbaf5687b9 | [
"Apache-2.0"
] | null | null | null | import itertools
import json
import linecache
import os
import pickle
import warnings
from logging import getLogger
from pathlib import Path
from typing import Callable, Dict, Iterable, List
import git
import numpy as np
import torch
from rouge_score import rouge_scorer, scoring
from sacrebleu import corpus_bleu
from ... | 33.966997 | 119 | 0.660707 | import itertools
import json
import linecache
import os
import pickle
import warnings
from logging import getLogger
from pathlib import Path
from typing import Callable, Dict, Iterable, List
import git
import numpy as np
import torch
from rouge_score import rouge_scorer, scoring
from sacrebleu import corpus_bleu
from ... | true | true |
1c13c1c6e590548e40d30eea7be12f50045b14d3 | 2,527 | py | Python | twistedchecker/checkers/header.py | twisted/twistedchecker | 4a69f3f7d80f2f42d915bc128d4257a2e15804e4 | [
"MIT"
] | 10 | 2015-01-06T14:59:50.000Z | 2021-01-10T19:06:16.000Z | twistedchecker/checkers/header.py | twisted/twistedchecker | 4a69f3f7d80f2f42d915bc128d4257a2e15804e4 | [
"MIT"
] | 76 | 2015-02-07T13:00:22.000Z | 2020-04-14T02:10:37.000Z | twistedchecker/checkers/header.py | twisted/twistedchecker | 4a69f3f7d80f2f42d915bc128d4257a2e15804e4 | [
"MIT"
] | 11 | 2015-05-24T15:55:49.000Z | 2017-10-15T11:34:35.000Z | import re
from pylint.interfaces import IAstroidChecker
from pylint.checkers import BaseChecker
from twistedchecker.core.util import isTestModule, moduleNeedsTests
class HeaderChecker(BaseChecker):
"""
A checker for checking headers.
Moudles must have a copyright message, a docstring and
a reference... | 34.148649 | 78 | 0.602295 | import re
from pylint.interfaces import IAstroidChecker
from pylint.checkers import BaseChecker
from twistedchecker.core.util import isTestModule, moduleNeedsTests
class HeaderChecker(BaseChecker):
msgs = {
'W9001': ('Missing copyright header',
'Used when a module of Twisted has no cop... | true | true |
1c13c2b9fe48f512490b8332666cb464d1c4a4b3 | 3,648 | py | Python | cogs/results/types.py | Xbox-360-1063/Kurisu | b6047ca02709a4b83c7ed429d1f08806243d6c86 | [
"Apache-2.0"
] | null | null | null | cogs/results/types.py | Xbox-360-1063/Kurisu | b6047ca02709a4b83c7ed429d1f08806243d6c86 | [
"Apache-2.0"
] | null | null | null | cogs/results/types.py | Xbox-360-1063/Kurisu | b6047ca02709a4b83c7ed429d1f08806243d6c86 | [
"Apache-2.0"
] | null | null | null | class Module:
"""
Describes a Module. A Module contains a dictionary of ResultCodes,
and possibly a second dictionary with extra information.
A module itself is basically who raised the error or returned the result.
"""
def __init__(self, name, data={}, summaries={}):
self.name = name
... | 35.076923 | 144 | 0.668586 | class Module:
def __init__(self, name, data={}, summaries={}):
self.name = name
self.data = data
self.summaries = summaries
def get_error(self, error: int):
value = self.data.get(error, None)
if value is not None:
return value
for key, value in self.d... | true | true |
1c13c3668b2f899e636a8503a77285af3c63190b | 53 | py | Python | src/opt/__init__.py | 1eedaegon/insta-auto | 1986a114432cdb2cb348199edfd2bd2b1cc21377 | [
"MIT"
] | null | null | null | src/opt/__init__.py | 1eedaegon/insta-auto | 1986a114432cdb2cb348199edfd2bd2b1cc21377 | [
"MIT"
] | null | null | null | src/opt/__init__.py | 1eedaegon/insta-auto | 1986a114432cdb2cb348199edfd2bd2b1cc21377 | [
"MIT"
] | null | null | null | from .settings import config
from .tools import timed | 26.5 | 28 | 0.830189 | from .settings import config
from .tools import timed | true | true |
1c13c366b909f7e42fea24b99ddb7b896ae61d25 | 4,377 | py | Python | poco/commands/repo_add.py | gaborkolarovics/poco | 31237ce9138c134e7780cd3ed7459cd5f4e07834 | [
"MIT"
] | 52 | 2017-10-13T06:11:41.000Z | 2021-12-08T08:08:48.000Z | poco/commands/repo_add.py | gaborkolarovics/poco | 31237ce9138c134e7780cd3ed7459cd5f4e07834 | [
"MIT"
] | 28 | 2017-08-02T13:55:53.000Z | 2017-09-07T14:31:55.000Z | poco/commands/repo_add.py | gaborkolarovics/poco | 31237ce9138c134e7780cd3ed7459cd5f4e07834 | [
"MIT"
] | 8 | 2018-02-16T10:51:27.000Z | 2022-02-04T11:17:44.000Z | from .abstract_command import AbstractCommand
from ..services.config_handler import ConfigHandler
from ..services.state import StateHolder
from ..services.state_utils import StateUtils
class RepoAdd(AbstractCommand):
sub_command = "repo"
command = ["add", "modify"]
args = ["<name>", "<git-url>", "[<branc... | 45.59375 | 120 | 0.592415 | from .abstract_command import AbstractCommand
from ..services.config_handler import ConfigHandler
from ..services.state import StateHolder
from ..services.state_utils import StateUtils
class RepoAdd(AbstractCommand):
sub_command = "repo"
command = ["add", "modify"]
args = ["<name>", "<git-url>", "[<branc... | true | true |
1c13c3777deb53e75c8217057d7eeb1d9587c62c | 1,580 | py | Python | remotejoystick/models/communication/sender.py | littlecodersh/remotejoysticks | 10d5e39bd143dafd49ad04b1bb746b58a86228a3 | [
"MIT"
] | 8 | 2016-09-13T06:36:58.000Z | 2021-11-18T13:57:44.000Z | remotejoystick/models/communication/sender.py | littlecodersh/RemoteJoystick | 10d5e39bd143dafd49ad04b1bb746b58a86228a3 | [
"MIT"
] | 1 | 2016-09-13T06:21:31.000Z | 2016-09-13T06:21:31.000Z | remotejoystick/models/communication/sender.py | littlecodersh/RemoteJoystick | 10d5e39bd143dafd49ad04b1bb746b58a86228a3 | [
"MIT"
] | 6 | 2017-08-07T04:13:59.000Z | 2019-04-16T01:46:02.000Z | import sys, select, socket
from .jssocket import jssocket
class sender(object):
__client = jssocket()
__connected = False
def __init__(self):
pass
def connect(self, serverInfo, verifyCode):
if self.__connected == True: return True
try:
self.__client.conn... | 33.617021 | 74 | 0.56962 | import sys, select, socket
from .jssocket import jssocket
class sender(object):
__client = jssocket()
__connected = False
def __init__(self):
pass
def connect(self, serverInfo, verifyCode):
if self.__connected == True: return True
try:
self.__client.conn... | true | true |
1c13c4416d134ed1700c60f73b0402b7dd9460e0 | 899 | py | Python | saleor/order/migrations/0039_auto_20180312_1203.py | igoryok-zp/saleor | 3a6fe51c068aca991331d6eb43317102ed68ed09 | [
"CC-BY-4.0"
] | 1 | 2021-04-15T07:15:47.000Z | 2021-04-15T07:15:47.000Z | saleor/order/migrations/0039_auto_20180312_1203.py | igoryok-zp/saleor | 3a6fe51c068aca991331d6eb43317102ed68ed09 | [
"CC-BY-4.0"
] | 1 | 2020-04-27T01:00:45.000Z | 2020-04-27T01:00:45.000Z | saleor/order/migrations/0039_auto_20180312_1203.py | techonomics69/saleor | fd4cf8531b65fed24b742d51bec8f015d61f3efc | [
"CC-BY-4.0"
] | 1 | 2021-04-15T07:16:34.000Z | 2021-04-15T07:16:34.000Z | # Generated by Django 2.0.2 on 2018-03-12 17:03
import django_prices.models
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("order", "0038_auto_20180228_0451")]
operations = [
migrations.AlterField(
model_name="or... | 26.441176 | 57 | 0.553949 |
import django_prices.models
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("order", "0038_auto_20180228_0451")]
operations = [
migrations.AlterField(
model_name="order",
name="total_gross",
... | true | true |
1c13c44f84becfe3a21b346fb4fb891bea40b370 | 334 | py | Python | backend/streams_explorer/models/kafka_connector.py | twiechert/streams-explorer | 7b5840f1efa0f7e352aef05ef8648188ee188f7a | [
"MIT"
] | 24 | 2021-02-17T16:29:07.000Z | 2022-01-03T05:13:31.000Z | backend/streams_explorer/models/kafka_connector.py | twiechert/streams-explorer | 7b5840f1efa0f7e352aef05ef8648188ee188f7a | [
"MIT"
] | 116 | 2021-02-03T08:44:27.000Z | 2022-03-22T09:50:03.000Z | backend/streams_explorer/models/kafka_connector.py | twiechert/streams-explorer | 7b5840f1efa0f7e352aef05ef8648188ee188f7a | [
"MIT"
] | 2 | 2021-04-06T15:34:37.000Z | 2021-05-14T16:52:44.000Z | from dataclasses import dataclass
from enum import Enum
from typing import List, Optional
class KafkaConnectorTypesEnum(str, Enum):
SINK = "sink"
SOURCE = "source"
@dataclass
class KafkaConnector:
name: str
type: KafkaConnectorTypesEnum
topics: List[str]
config: dict
error_topic: Optiona... | 18.555556 | 41 | 0.724551 | from dataclasses import dataclass
from enum import Enum
from typing import List, Optional
class KafkaConnectorTypesEnum(str, Enum):
SINK = "sink"
SOURCE = "source"
@dataclass
class KafkaConnector:
name: str
type: KafkaConnectorTypesEnum
topics: List[str]
config: dict
error_topic: Optiona... | true | true |
1c13c4870cbe06754a991af4bc775ab978b56f92 | 2,978 | py | Python | mlir/test/python/ir/location.py | yuriykoch/llvm | c4ce4f0feb46ec7dd4235fa2709609be06fb2153 | [
"Apache-2.0"
] | 605 | 2019-10-18T01:15:54.000Z | 2022-03-31T14:31:04.000Z | mlir/test/python/ir/location.py | yuriykoch/llvm | c4ce4f0feb46ec7dd4235fa2709609be06fb2153 | [
"Apache-2.0"
] | 3,180 | 2019-10-18T01:21:21.000Z | 2022-03-31T23:25:41.000Z | mlir/test/python/ir/location.py | yuriykoch/llvm | c4ce4f0feb46ec7dd4235fa2709609be06fb2153 | [
"Apache-2.0"
] | 275 | 2019-10-18T05:27:22.000Z | 2022-03-30T09:04:21.000Z | # RUN: %PYTHON %s | FileCheck %s
import gc
from mlir.ir import *
def run(f):
print("\nTEST:", f.__name__)
f()
gc.collect()
assert Context._get_live_count() == 0
# CHECK-LABEL: TEST: testUnknown
def testUnknown():
with Context() as ctx:
loc = Location.unknown()
assert loc.context is ctx
ctx = None
... | 26.828829 | 105 | 0.643049 |
import gc
from mlir.ir import *
def run(f):
print("\nTEST:", f.__name__)
f()
gc.collect()
assert Context._get_live_count() == 0
def testUnknown():
with Context() as ctx:
loc = Location.unknown()
assert loc.context is ctx
ctx = None
gc.collect()
print("unknown str:", str(loc))
print("unkn... | true | true |
1c13c4bc61f75f7de6e81da129f2fb86d51cd658 | 241 | py | Python | my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805221031.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805221031.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805221031.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """Import Variants and some misconceptions
# module1.py
import math
sys.modules
is math in sys.modules? math <module object>
if not, load and insert ref
add symbol math to modules
""" | 24.1 | 60 | 0.585062 | true | true | |
1c13c548f008c50a650f7040f30490bd85e5c200 | 11,019 | py | Python | mycroft/client/speech/hotword_factory.py | JuliaC29/mycroft-core | 1599452eb1d6a8c4ad5585101f30bc346bfe01d2 | [
"Apache-2.0"
] | 1 | 2019-04-15T14:04:02.000Z | 2019-04-15T14:04:02.000Z | mycroft/client/speech/hotword_factory.py | JuliaC29/mycroft-core | 1599452eb1d6a8c4ad5585101f30bc346bfe01d2 | [
"Apache-2.0"
] | null | null | null | mycroft/client/speech/hotword_factory.py | JuliaC29/mycroft-core | 1599452eb1d6a8c4ad5585101f30bc346bfe01d2 | [
"Apache-2.0"
] | 1 | 2020-07-08T11:10:51.000Z | 2020-07-08T11:10:51.000Z | # Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 36.486755 | 78 | 0.623287 | import time
from time import sleep
import os
import platform
import posixpath
import tempfile
import requests
from contextlib import suppress
from glob import glob
from os.path import dirname, exists, join, abspath, expanduser, isfile, isdir
from petact import install_package
from shutil import rmtree
from threading i... | true | true |
1c13c5818502be8d7c5e33717b65e5771c7f824d | 1,290 | py | Python | bin/main.py | BobDotCom/bftools | 6b3e0e55f2e5154f5d48d9606ac18833120c1420 | [
"MIT"
] | 1 | 2022-02-02T19:22:49.000Z | 2022-02-02T19:22:49.000Z | bin/main.py | BobDotCom/bftools | 6b3e0e55f2e5154f5d48d9606ac18833120c1420 | [
"MIT"
] | 1 | 2021-11-21T05:03:59.000Z | 2022-03-20T00:42:19.000Z | bin/main.py | BobDotCom/bftools | 6b3e0e55f2e5154f5d48d9606ac18833120c1420 | [
"MIT"
] | null | null | null | import argparse
import bftools
parser = argparse.ArgumentParser(description='bftools brainfuck toolbox')
parser.add_argument('-v', '--verbose', help='verbose output (not implemented yet)', action='store_true')
parser.add_argument('-V', '--version', help='show version', action='version',
version='%... | 39.090909 | 104 | 0.713178 | import argparse
import bftools
parser = argparse.ArgumentParser(description='bftools brainfuck toolbox')
parser.add_argument('-v', '--verbose', help='verbose output (not implemented yet)', action='store_true')
parser.add_argument('-V', '--version', help='show version', action='version',
version='%... | true | true |
1c13c5ed0a286ba2c1bf750fa4833de0409bfefc | 8,975 | py | Python | examples/TinyALU/testbench.py | Godhart/forks-pyuvm | fc300e491447ac4d3fe20ee805b9517499aa2079 | [
"Apache-2.0"
] | 4 | 2021-11-07T13:22:27.000Z | 2022-02-17T08:51:24.000Z | examples/TinyALU/testbench.py | Godhart/forks-pyuvm | fc300e491447ac4d3fe20ee805b9517499aa2079 | [
"Apache-2.0"
] | null | null | null | examples/TinyALU/testbench.py | Godhart/forks-pyuvm | fc300e491447ac4d3fe20ee805b9517499aa2079 | [
"Apache-2.0"
] | null | null | null | from cocotb.triggers import Join, Combine
from pyuvm import *
import random
import cocotb
import pyuvm
# All testbenches use tinyalu_utils, so store it in a central
# place and add its path to the sys path so we can import it
import sys
from pathlib import Path
sys.path.append(str(Path("..").resolve()))
from tinyalu_ut... | 29.916667 | 79 | 0.607577 | from cocotb.triggers import Join, Combine
from pyuvm import *
import random
import cocotb
import pyuvm
import sys
from pathlib import Path
sys.path.append(str(Path("..").resolve()))
from tinyalu_utils import TinyAluBfm, Ops, alu_prediction
class AluSeqItem(uvm_sequence_item):
def __init__(self, name, aa, bb, o... | true | true |
1c13c66685f791cf6afbfa2c6c4811f58ce3ef17 | 495 | py | Python | source/api/templates/templates.py | eaxr/elasticsearch-cli | 4eae551d8099f02a30443749eae09efbb636ea57 | [
"MIT"
] | 4 | 2019-07-13T13:29:31.000Z | 2021-04-01T10:05:25.000Z | source/api/templates/templates.py | eaxr/elasticsearch-cli | 4eae551d8099f02a30443749eae09efbb636ea57 | [
"MIT"
] | null | null | null | source/api/templates/templates.py | eaxr/elasticsearch-cli | 4eae551d8099f02a30443749eae09efbb636ea57 | [
"MIT"
] | 4 | 2019-08-21T15:59:37.000Z | 2021-04-01T11:48:41.000Z |
import click
import json
from source.es_connect import es_connect
def get_templates(name, local, timeout, format):
es = es_connect()
indices = es.cat.templates(
name=name, local=local, master_timeout=timeout, format=format)
if format == 'json':
click.echo(json.dumps(indices, indent=4))
... | 24.75 | 77 | 0.70101 |
import click
import json
from source.es_connect import es_connect
def get_templates(name, local, timeout, format):
es = es_connect()
indices = es.cat.templates(
name=name, local=local, master_timeout=timeout, format=format)
if format == 'json':
click.echo(json.dumps(indices, indent=4))
... | true | true |
1c13c7cbb3eb58b2e23a3f4fd88aa78e414f7f27 | 794 | py | Python | tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py | nickerso/libcellml | 9fe5ecabc3e63c49d5ee8539ed2c8ce572a9712a | [
"Apache-2.0"
] | null | null | null | tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py | nickerso/libcellml | 9fe5ecabc3e63c49d5ee8539ed2c8ce572a9712a | [
"Apache-2.0"
] | null | null | null | tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py | nickerso/libcellml | 9fe5ecabc3e63c49d5ee8539ed2c8ce572a9712a | [
"Apache-2.0"
] | null | null | null | # The content of this file was generated using the Python profile of libCellML 0.2.0.
from enum import Enum
from math import *
__version__ = "0.3.0"
LIBCELLML_VERSION = "0.2.0"
VARIABLE_COUNT = 2
class VariableType(Enum):
CONSTANT = 1
COMPUTED_CONSTANT = 2
ALGEBRAIC = 3
VARIABLE_INFO = [
{"name"... | 20.358974 | 117 | 0.710327 |
from enum import Enum
from math import *
__version__ = "0.3.0"
LIBCELLML_VERSION = "0.2.0"
VARIABLE_COUNT = 2
class VariableType(Enum):
CONSTANT = 1
COMPUTED_CONSTANT = 2
ALGEBRAIC = 3
VARIABLE_INFO = [
{"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType... | true | true |
1c13ca1ce87c4d35311918dada1f6bf2fc96566d | 133 | py | Python | frappymongodataset/__init__.py | ilfrich/frappy-py-mongo-dataset-store | 38d6217499faeb975b661846a5f9dc1efb120c92 | [
"Apache-2.0"
] | null | null | null | frappymongodataset/__init__.py | ilfrich/frappy-py-mongo-dataset-store | 38d6217499faeb975b661846a5f9dc1efb120c92 | [
"Apache-2.0"
] | null | null | null | frappymongodataset/__init__.py | ilfrich/frappy-py-mongo-dataset-store | 38d6217499faeb975b661846a5f9dc1efb120c92 | [
"Apache-2.0"
] | null | null | null | from frappymongodataset.data_store import DataStore, Data, DataImagePayload, DataJsonPayload, DataTimeSeriesPayload, \
DataTypes
| 44.333333 | 118 | 0.842105 | from frappymongodataset.data_store import DataStore, Data, DataImagePayload, DataJsonPayload, DataTimeSeriesPayload, \
DataTypes
| true | true |
1c13cbffeac667d9cfafb4e0857b37999bfc095b | 5,498 | py | Python | src/controller/controller_player.py | lclpsoz/corrida-ga | 494c7fd1a6c87b42c12b76045a57d52ffc1e40a2 | [
"MIT"
] | null | null | null | src/controller/controller_player.py | lclpsoz/corrida-ga | 494c7fd1a6c87b42c12b76045a57d52ffc1e40a2 | [
"MIT"
] | 3 | 2020-03-22T14:29:19.000Z | 2020-03-24T03:03:03.000Z | src/controller/controller_player.py | lclpsoz/corrida-ga | 494c7fd1a6c87b42c12b76045a57d52ffc1e40a2 | [
"MIT"
] | null | null | null | import pygame
from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
import numpy as np
from datetime import datetime
import time
from car import Car
from view import View
from controller.controller import Controller
from circuit.circuit import Circuit
from circuit.circuit_maker import Circuit... | 41.969466 | 114 | 0.555293 | import pygame
from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
import numpy as np
from datetime import datetime
import time
from car import Car
from view import View
from controller.controller import Controller
from circuit.circuit import Circuit
from circuit.circuit_maker import Circuit... | true | true |
1c13ccb223f7b1a78fa9171827d05e1d5f58a1f4 | 20,275 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/api/auth_users_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/api/auth_users_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/api/auth_users_api.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and pyt... | 41.632444 | 150 | 0.625499 |
from __future__ import absolute_import
import re
import six
from isi_sdk_9_0_0.api_client import ApiClient
class AuthUsersApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def create_user_member_o... | true | true |
1c13ccd9d570ebe36eccaccdef983c488c40dfac | 4,989 | py | Python | lambda_function.py | lucasschoch/CloudfrontToElasticSearch | 9a282e0978db8f9dc72680ccceb2d7bac20e4e2f | [
"MIT"
] | null | null | null | lambda_function.py | lucasschoch/CloudfrontToElasticSearch | 9a282e0978db8f9dc72680ccceb2d7bac20e4e2f | [
"MIT"
] | null | null | null | lambda_function.py | lucasschoch/CloudfrontToElasticSearch | 9a282e0978db8f9dc72680ccceb2d7bac20e4e2f | [
"MIT"
] | 2 | 2021-11-27T13:08:32.000Z | 2022-01-02T23:47:06.000Z | from __future__ import print_function
from pprint import pprint
import boto3
import json
import zlib
import datetime
from itertools import groupby
from elasticsearch import Elasticsearch, RequestsHttpConnection
from StringIO import StringIO
import urllib
import json
s3 = boto3.client('s3')
now = datetime.datetime.n... | 29.005814 | 153 | 0.475246 | from __future__ import print_function
from pprint import pprint
import boto3
import json
import zlib
import datetime
from itertools import groupby
from elasticsearch import Elasticsearch, RequestsHttpConnection
from StringIO import StringIO
import urllib
import json
s3 = boto3.client('s3')
now = datetime.datetime.n... | false | true |
1c13cd4b564846d5d953661849d1f7c696f996a6 | 2,741 | py | Python | evaluate/metrics/lvs.py | fhvilshoj/EvaluatingCounterfactuals | 136fd5f7fca5c886082c0597d2fc581705113870 | [
"MIT"
] | 1 | 2022-01-16T08:12:03.000Z | 2022-01-16T08:12:03.000Z | evaluate/metrics/lvs.py | fhvilshoj/EvaluatingCounterfactuals | 136fd5f7fca5c886082c0597d2fc581705113870 | [
"MIT"
] | null | null | null | evaluate/metrics/lvs.py | fhvilshoj/EvaluatingCounterfactuals | 136fd5f7fca5c886082c0597d2fc581705113870 | [
"MIT"
] | 2 | 2021-11-02T13:22:24.000Z | 2021-12-03T17:47:01.000Z | import os
import numpy as np
from tensorflow.keras.models import load_model
# Local imports
from .utils import fix_shape, get_model_dir
from .computer import Computer
MODEL_NAMES = {
'fakemnist': ['independent.h5', 'independent_mnist.h5'],
'celeba': ['independent_makeup.h5', 'independent_cheekbones.h5... | 30.797753 | 155 | 0.554177 | import os
import numpy as np
from tensorflow.keras.models import load_model
from .utils import fix_shape, get_model_dir
from .computer import Computer
MODEL_NAMES = {
'fakemnist': ['independent.h5', 'independent_mnist.h5'],
'celeba': ['independent_makeup.h5', 'independent_cheekbones.h5', 'independent_... | true | true |
1c13cdd6d22222ce76257dfc1a57b13e5e59f585 | 2,388 | py | Python | .leetcode/508.most-frequent-subtree-sum.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/508.most-frequent-subtree-sum.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/508.most-frequent-subtree-sum.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=508 lang=python3
#
# [508] Most Frequent Subtree Sum
#
# https://leetcode.com/problems/most-frequent-subtree-sum/description/
#
# algorithms
# Medium (60.71%)
# Likes: 1104
# Dislikes: 178
# Total Accepted: 93.9K
# Total Submissions: 154.2K
# Testcase Example: '[5,2,-3]'
#
# Given the root ... | 19.258065 | 79 | 0.553183 |
from imports import *
class Solution:
def findFrequentTreeSum(self, root: Optional[TreeNode]) -> List[int]:
d = defaultdict(int)
def recur(p: TreeNode):
if not p:
return 0
pl, pr = recur(p.left), recur(p.right)
s = p.val + pl + pr
... | true | true |
1c13cf129727dd106358ede7f1c2eba6fe701c1d | 29,219 | py | Python | packstack/plugins/nova_300.py | strider/packstack | 8157722953234d00a2dc4ca6bca940464e70a614 | [
"Apache-2.0"
] | null | null | null | packstack/plugins/nova_300.py | strider/packstack | 8157722953234d00a2dc4ca6bca940464e70a614 | [
"Apache-2.0"
] | null | null | null | packstack/plugins/nova_300.py | strider/packstack | 8157722953234d00a2dc4ca6bca940464e70a614 | [
"Apache-2.0"
] | null | null | null | # -*- 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... | 40.694986 | 99 | 0.601287 |
import os
import platform
import socket
from packstack.installer import basedefs
from packstack.installer import processors
from packstack.installer import utils
from packstack.installer import validators
from packstack.installer.exceptions import ScriptRuntimeError
from packstack.modules.shortcuts import get_mq
fr... | true | true |
1c13d03bb3edda56ce2ea4d5f3deadf911aad0e4 | 401 | py | Python | django_movie/wsgi.py | Viktor-Omelianchuk/django_based_movie_app | 43a2481a8fa3cc49fc132b664b417aaf51b698ac | [
"MIT"
] | null | null | null | django_movie/wsgi.py | Viktor-Omelianchuk/django_based_movie_app | 43a2481a8fa3cc49fc132b664b417aaf51b698ac | [
"MIT"
] | null | null | null | django_movie/wsgi.py | Viktor-Omelianchuk/django_based_movie_app | 43a2481a8fa3cc49fc132b664b417aaf51b698ac | [
"MIT"
] | null | null | null | """
WSGI config for django_movie 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.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_movie.settings")
application = get_wsgi_application()
| true | true |
1c13d0520cf70903ca15362e15a21c9f876a001a | 782 | py | Python | utils/download.py | bongsang/multi-classification | e3d578930d1d8b4a1c54a51bcbb80909bd456f6d | [
"MIT"
] | null | null | null | utils/download.py | bongsang/multi-classification | e3d578930d1d8b4a1c54a51bcbb80909bd456f6d | [
"MIT"
] | null | null | null | utils/download.py | bongsang/multi-classification | e3d578930d1d8b4a1c54a51bcbb80909bd456f6d | [
"MIT"
] | null | null | null | __author__ = "https://www.linkedin.com/in/bongsang/"
__license__ = "MIT"
import os
import requests
import tqdm # progress bar
def from_url(url, path):
if not os.path.isdir(path):
os.makedirs(path)
filename = os.path.join(path, url.split('/')[-1])
r = requests.get(url, stream=True)
file_size ... | 25.225806 | 53 | 0.574169 | __author__ = "https://www.linkedin.com/in/bongsang/"
__license__ = "MIT"
import os
import requests
import tqdm
def from_url(url, path):
if not os.path.isdir(path):
os.makedirs(path)
filename = os.path.join(path, url.split('/')[-1])
r = requests.get(url, stream=True)
file_size = int(r.headers... | true | true |
1c13d056a49c7524ba151e710bf17e65367335b3 | 2,600 | py | Python | aliyun-python-sdk-green/setup.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-green/setup.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-green/setup.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | 1 | 2021-01-26T05:01:42.000Z | 2021-01-26T05:01:42.000Z | #!/usr/bin/python
'''
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"... | 30.588235 | 69 | 0.668462 |
from setuptools import setup, find_packages
import os
import sys
PACKAGE = "aliyunsdkgreen"
NAME = "aliyun-python-sdk-green"
DESCRIPTION = "The green module of Aliyun Python sdk."
AUTHOR = "Aliyun"
AUTHOR_EMAIL = "aliyun-developers-efficiency@list.alibaba-inc.com"
URL = "http://develop.aliyun.com/sdk/python"
TOPDIR... | true | true |
1c13d0d58d431373cd73f8e765c5d8dcf36412cb | 2,181 | py | Python | django_tastypie_example/django_tastypie_example/settings/production.py | pankaj28843/django-tastypie-custom-user-example | ebfefa17badbc348183818338c5f677c5fa8fa52 | [
"MIT"
] | 1 | 2020-01-23T06:21:53.000Z | 2020-01-23T06:21:53.000Z | django_tastypie_example/django_tastypie_example/settings/production.py | pankaj28843/django-tastypie-custom-user-example | ebfefa17badbc348183818338c5f677c5fa8fa52 | [
"MIT"
] | null | null | null | django_tastypie_example/django_tastypie_example/settings/production.py | pankaj28843/django-tastypie-custom-user-example | ebfefa17badbc348183818338c5f677c5fa8fa52 | [
"MIT"
] | null | null | null | '''Production settings and globals.'''
from os import environ
from base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
def get_env_setting(setting):
''' Get the envi... | 32.552239 | 95 | 0.727648 |
from os import environ
from base import *
from django.core.exceptions import ImproperlyConfigured
def get_env_setting(setting):
try:
return environ[setting]
except KeyError:
error_msg = 'Set the %s env variable' % setting
raise ImproperlyConfigured(error_msg)
ALLOWED_HOSTS = []
E... | true | true |
1c13d0f5b9fb7314cf3b8938bdd75ef47cac77a1 | 3,842 | py | Python | stdplugins/telegraph.py | andromechanic/BotHub | 18853e3a5f2a1ecdc93f9d6173411baf89dd8f00 | [
"Apache-2.0"
] | 25 | 2019-10-26T08:01:11.000Z | 2022-02-21T08:18:00.000Z | stdplugins/telegraph.py | shn999/PepeBot | 912b97dc89c4c7581cbaee337d4fcc05c98d79c0 | [
"Apache-2.0"
] | 2 | 2020-05-11T08:42:33.000Z | 2020-05-21T02:30:09.000Z | stdplugins/telegraph.py | shn999/PepeBot | 912b97dc89c4c7581cbaee337d4fcc05c98d79c0 | [
"Apache-2.0"
] | 291 | 2019-11-06T04:25:13.000Z | 2021-10-03T15:56:23.000Z | """@telegraph Utilities
Available Commands:
.telegraph media as reply to a media
.telegraph text as reply to a large text"""
from telethon import events
import os
from PIL import Image
from datetime import datetime
from telegraph import Telegraph, upload_file, exceptions
from uniborg.util import admin_cmd
telegraph = ... | 42.21978 | 163 | 0.610619 | from telethon import events
import os
from PIL import Image
from datetime import datetime
from telegraph import Telegraph, upload_file, exceptions
from uniborg.util import admin_cmd
telegraph = Telegraph()
r = telegraph.create_account(short_name=Config.TELEGRAPH_SHORT_NAME)
auth_url = r["auth_url"]
@borg.on(admin_cm... | true | true |
1c13d17a7864032f70aa001a71bebde4fbddec7a | 9,757 | py | Python | coloredlogs/syslog.py | ngoctnq/cm_factorization | 3faec03497db72fd36045f1ed3d9e136141b3506 | [
"MIT"
] | 28 | 2018-12-22T13:47:20.000Z | 2022-02-21T14:26:40.000Z | coloredlogs/syslog.py | ngoctnq/cm_factorization | 3faec03497db72fd36045f1ed3d9e136141b3506 | [
"MIT"
] | 1 | 2021-06-02T00:41:48.000Z | 2021-06-02T00:41:48.000Z | coloredlogs/syslog.py | ngoctnq/cm_factorization | 3faec03497db72fd36045f1ed3d9e136141b3506 | [
"MIT"
] | 7 | 2019-02-09T23:44:41.000Z | 2022-02-14T03:16:23.000Z | # Easy to use system logging for Python's logging module.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: April 17, 2017
# URL: https://coloredlogs.readthedocs.io
"""
Easy to use UNIX system logging for Python's :mod:`logging` module.
Admittedly system logging has little to do with colored terminal ou... | 40.995798 | 101 | 0.673158 | #
# Author: Peter Odding <peter@peterodding.com>
# Last Change: April 17, 2017
# URL: https://coloredlogs.readthedocs.io
# Standard library modules.
import logging
import logging.handlers
import os
import socket
import sys
# Modules included in our package.
from coloredlogs import (
DEFAULT_LOG_LEVEL,
Progra... | true | true |
1c13d1b36847a60bca7cb9c14376cdc4611942e7 | 786 | py | Python | tests/util/yaml/test_input.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | tests/util/yaml/test_input.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/util/yaml/test_input.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Test inputs."""
import pytest
from homeassistant.util.yaml import (
Input,
UndefinedSubstitution,
extract_inputs,
substitute,
)
def test_extract_inputs():
"""Test extracting inputs from data."""
assert extract_inputs(Input("hello")) == {"hello"}
assert extract_inputs({"info": [1, Input... | 22.457143 | 80 | 0.553435 | import pytest
from homeassistant.util.yaml import (
Input,
UndefinedSubstitution,
extract_inputs,
substitute,
)
def test_extract_inputs():
assert extract_inputs(Input("hello")) == {"hello"}
assert extract_inputs({"info": [1, Input("hello"), 2, Input("world")]}) == {
"hello",
"... | true | true |
1c13d365f702cad53dc2ecd3cc2ed655838da03d | 744 | py | Python | django/contrib/gis/geos/io.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | 1 | 2015-11-08T11:42:08.000Z | 2015-11-08T11:42:08.000Z | django/contrib/gis/geos/io.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/geos/io.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | """
Module that holds classes for performing I/O operations on GEOS geometry
objects. Specifically, this has Python implementations of WKB/WKT
reader and writer classes.
"""
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WK... | 39.157895 | 94 | 0.754032 | from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes.io import _WKTReader, _WKBReader, WKBWriter, WKTWriter
class WKBReader(_WKBReader):
def read(self, wkb):
return GEOSGeometry(super(WKBReader, self).read(wkb))
class WKTReader(_WKTReader):
def read(self, w... | true | true |
1c13d59c3dc980521efb72dec4b6e345ea5dc171 | 8,246 | py | Python | solid2cluster/build_analysis_dir.py | golharam/genomics | ca0c7c239b0f04353e2f2fa897db9c24a1211596 | [
"Artistic-2.0"
] | 49 | 2015-01-03T17:09:10.000Z | 2022-03-17T19:28:08.000Z | solid2cluster/build_analysis_dir.py | burkesquires/genomics | 9dd93a23e6401bcaa2d2ac17e319d72b0c80a410 | [
"AFL-3.0"
] | 59 | 2015-04-16T14:21:04.000Z | 2022-03-15T11:56:33.000Z | solid2cluster/build_analysis_dir.py | burkesquires/genomics | 9dd93a23e6401bcaa2d2ac17e319d72b0c80a410 | [
"AFL-3.0"
] | 29 | 2015-01-29T08:50:44.000Z | 2021-08-19T02:15:44.000Z | #!/usr/bin/env python
#
# build_analysis_dir.py: build directory with links to primary data
# Copyright (C) University of Manchester 2011 Peter Briggs
#
########################################################################
#
# build_analysis_dir.py
#
##########################################################... | 39.266667 | 87 | 0.526437 |
import sys,os
import logging
logging.basicConfig(format="%(levelname)s %(message)s")
SHARE_DIR = os.path.abspath(
os.path.normpath(
os.path.join(os.path.dirname(sys.argv[0]),'..')))
sys.path.append(SHARE_DIR)
import bcftbx.SolidData as SolidData
import bcftbx.Experiment as Experiment
import bcftbx.JobRu... | true | true |
1c13d5fb8089b28b23ba76bfeab95f6d6813deb2 | 12,144 | py | Python | imagenet/l1-norm-pruning/main_finetune.py | fangyuchu/rethinking-network-pruning | 3d3726e1277b5d9bd12b2b26d3c9bf1730709a42 | [
"MIT"
] | null | null | null | imagenet/l1-norm-pruning/main_finetune.py | fangyuchu/rethinking-network-pruning | 3d3726e1277b5d9bd12b2b26d3c9bf1730709a42 | [
"MIT"
] | null | null | null | imagenet/l1-norm-pruning/main_finetune.py | fangyuchu/rethinking-network-pruning | 3d3726e1277b5d9bd12b2b26d3c9bf1730709a42 | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transf... | 37.251534 | 115 | 0.606719 | import argparse
import os
import numpy as np
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transf... | true | true |
1c13d6a0a1000afd2dc4458da325c34c553e8238 | 36,045 | py | Python | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_apps_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_apps_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_apps_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 1 | 2021-12-18T20:01:22.000Z | 2021-12-18T20:01:22.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.580468 | 221 | 0.661562 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
1c13d8ad501c82ab5acd3ce5b603e87386664a36 | 2,184 | py | Python | sushy/tests/unit/resources/taskservice/test_taskservice.py | calsoft-internal/sushy | ffa84846fdb8691042f2156e64649a98feb1f4a2 | [
"Apache-2.0"
] | null | null | null | sushy/tests/unit/resources/taskservice/test_taskservice.py | calsoft-internal/sushy | ffa84846fdb8691042f2156e64649a98feb1f4a2 | [
"Apache-2.0"
] | null | null | null | sushy/tests/unit/resources/taskservice/test_taskservice.py | calsoft-internal/sushy | ffa84846fdb8691042f2156e64649a98feb1f4a2 | [
"Apache-2.0"
] | null | null | null | # 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 under the... | 39.709091 | 76 | 0.72848 |
import json
from unittest import mock
from sushy.resources import constants as res_cons
from sushy.resources.taskservice import constants as ts_cons
from sushy.resources.taskservice import task
from sushy.resources.taskservice import taskservice
from sushy.tests.unit import base
class TaskServiceTestCase(base.TestC... | true | true |
1c13d8fb8cd2e3c46b4a02d807acec275ac24f7e | 676 | py | Python | scripts/animation_complete.py | BrancoLab/Kino | 0e914e3d65fdf76e4efa95b9848cb30da3653f3d | [
"MIT"
] | 1 | 2021-12-09T09:19:25.000Z | 2021-12-09T09:19:25.000Z | scripts/animation_complete.py | BrancoLab/Kino | 0e914e3d65fdf76e4efa95b9848cb30da3653f3d | [
"MIT"
] | null | null | null | scripts/animation_complete.py | BrancoLab/Kino | 0e914e3d65fdf76e4efa95b9848cb30da3653f3d | [
"MIT"
] | null | null | null | import sys
sys.path.append("./")
import pandas as pd
from kino.animal import mouse
from kino.locomotion import Locomotion
from kino.animate import CompleteAnimation
"""
Creates a slowmo animation of the locomotion bout
in the allocentric and egocentric views
"""
tracking = pd.read_hdf("scripts/example_tra... | 19.882353 | 68 | 0.732249 | import sys
sys.path.append("./")
import pandas as pd
from kino.animal import mouse
from kino.locomotion import Locomotion
from kino.animate import CompleteAnimation
tracking = pd.read_hdf("scripts/example_tracking.h5")
locomotion = Locomotion(mouse, tracking, fps=60)
for bp in locomotion.bodyparts.values():
... | true | true |
1c13d9959ddf35b45a9c13a4751c0f7a486ad58c | 6,238 | py | Python | tests/New_Rochelle/2021/check_population.py | atruszkowska/NR-population-revac | 3f35be85755bc7233cd1330ea1fbc0346c8dc04c | [
"MIT"
] | null | null | null | tests/New_Rochelle/2021/check_population.py | atruszkowska/NR-population-revac | 3f35be85755bc7233cd1330ea1fbc0346c8dc04c | [
"MIT"
] | null | null | null | tests/New_Rochelle/2021/check_population.py | atruszkowska/NR-population-revac | 3f35be85755bc7233cd1330ea1fbc0346c8dc04c | [
"MIT"
] | 1 | 2021-09-21T18:56:10.000Z | 2021-09-21T18:56:10.000Z | # ------------------------------------------------------------------
#
# Check generated population
#
# ------------------------------------------------------------------
import sys
py_path = '../../../src/mobility/'
sys.path.insert(0, py_path)
py_path = '../../../input_verification/'
sys.path.insert(0, py_path)
im... | 33.005291 | 157 | 0.767554 |
import sys
py_path = '../../../src/mobility/'
sys.path.insert(0, py_path)
py_path = '../../../input_verification/'
sys.path.insert(0, py_path)
import check_agents as ca
import check_households as ch
import abm_residential as res
import abm_public as public
import abm_agents as agents
import abm_transit as travel
d... | true | true |
1c13dac0d6f73c011f5b7445cc7d7ee913a6882c | 1,127 | py | Python | tests/postgres.ext/postgres_reserved.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | null | null | null | tests/postgres.ext/postgres_reserved.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T23:42:13.000Z | 2021-06-10T23:42:13.000Z | tests/postgres.ext/postgres_reserved.py | jlmaurer/pyre | 6af38a83621d7d6228d147b4bb94f97fbb10f6e2 | [
"BSD-3-Clause"
] | 2 | 2020-08-31T18:07:52.000Z | 2021-12-10T08:54:39.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2020 all rights reserved
#
"""
Check that the table attributes we use to specify query parameters are treated reserved
keywords by the back end, which makes it unnecessary to place them in the {pyre_} namespace.
"""
impo... | 17.609375 | 92 | 0.625555 |
import pyre.db
def test():
db = pyre.db.postgres(name="test").attach()
class invalid(pyre.db.table):
order = pyre.db.str()
try:
db.createTable(invalid)
assert False
except db.exceptions.ProgrammingError:
pass
class invalid(pyre.db.table):
... | true | true |
1c13db0a1dd6e82bf74d70131f6ffb554a417a49 | 4,414 | py | Python | DQMServices/Components/python/test/check_merged_file1_file2_cfg.py | trackerpro/cmssw | 3e05774a180a5f4cdc70b713bd711c23f9364765 | [
"Apache-2.0"
] | 1 | 2019-03-09T19:47:49.000Z | 2019-03-09T19:47:49.000Z | DQMServices/Components/python/test/check_merged_file1_file2_cfg.py | trackerpro/cmssw | 3e05774a180a5f4cdc70b713bd711c23f9364765 | [
"Apache-2.0"
] | null | null | null | DQMServices/Components/python/test/check_merged_file1_file2_cfg.py | trackerpro/cmssw | 3e05774a180a5f4cdc70b713bd711c23f9364765 | [
"Apache-2.0"
] | 1 | 2019-03-19T13:44:54.000Z | 2019-03-19T13:44:54.000Z | from __future__ import print_function
import ROOT as R
import sys
f = R.TFile.Open("dqm_merged_file1_file2.root")
folder = "TestFolder/"
th1fs = f.Get("TH1Fs")
indices = f.Get("Indices")
# Run, Lumi, Type, FirstIndex, LastIndex
# 1 1 3(TH1Fs) 0 11
# 1 ... | 38.719298 | 98 | 0.522655 | from __future__ import print_function
import ROOT as R
import sys
f = R.TFile.Open("dqm_merged_file1_file2.root")
folder = "TestFolder/"
th1fs = f.Get("TH1Fs")
indices = f.Get("Indices")
# integrate over all {RUN,LS}-base histograms (Foo+Bar) *before*
# putting an entry in this list.
expectedIndices = list()
val... | true | true |
1c13db86c3ba342fb09d4047af24df3d1a979c73 | 2,612 | py | Python | testing/test_awswrangler/test_spark.py | stijndehaes/aws-data-wrangler | 4c95e87d2850ce028c00525c73567c77f83001c5 | [
"Apache-2.0"
] | null | null | null | testing/test_awswrangler/test_spark.py | stijndehaes/aws-data-wrangler | 4c95e87d2850ce028c00525c73567c77f83001c5 | [
"Apache-2.0"
] | null | null | null | testing/test_awswrangler/test_spark.py | stijndehaes/aws-data-wrangler | 4c95e87d2850ce028c00525c73567c77f83001c5 | [
"Apache-2.0"
] | 1 | 2019-09-19T13:09:42.000Z | 2019-09-19T13:09:42.000Z | import logging
import pytest
import boto3
from pyspark.sql import SparkSession
from awswrangler import Session
logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s][%(levelname)s][%(name)s][%(funcName)s] %(message)s")
logging.getLogger("awswrangler").setLevel(logging.DEBUG)
@pytest.fixture(scope="... | 36.277778 | 88 | 0.617917 | import logging
import pytest
import boto3
from pyspark.sql import SparkSession
from awswrangler import Session
logging.basicConfig(
level=logging.INFO,
format="[%(asctime)s][%(levelname)s][%(name)s][%(funcName)s] %(message)s")
logging.getLogger("awswrangler").setLevel(logging.DEBUG)
@pytest.fixture(scope="... | true | true |
1c13db8cccd644faa022f23271af9e162de24fe9 | 1,879 | py | Python | Medium/368.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 6 | 2017-09-25T18:05:50.000Z | 2019-03-27T00:23:15.000Z | Medium/368.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 1 | 2017-10-29T12:04:41.000Z | 2018-08-16T18:00:37.000Z | Medium/368.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | null | null | null | # ------------------------------
# 368. Largest Divisible Subset
#
# Description:
# Given a set of distinct positive integers, find the largest subset such that every pair
# (Si, Sj) of elements in this subset satisfies:
#
# Si % Sj = 0 or Sj % Si = 0.
#
# If there are multiple solutions, return any subset is fine.... | 31.847458 | 126 | 0.538052 |
class Solution:
def largestDivisibleSubset(self, nums: List[int]) -> List[int]:
n = len(nums)
count = [1 for _ in range(n)] pre = [-1 for _ in range(n)] nums.sort()
maxSize = 0
index = -1
for i in range(n):
for j in range(i)[::-1]:
... | true | true |
1c13db8f53142458ff5d0ddde03c5c32c6e6b709 | 8,643 | py | Python | core/controllers/domain_objects_validator_test.py | Tim810306/oppia | 6f90044d12dbe0979c999265cbe46f267c4c592d | [
"Apache-2.0"
] | 2 | 2021-05-24T10:23:32.000Z | 2021-08-22T18:50:14.000Z | core/controllers/domain_objects_validator_test.py | Tim810306/oppia | 6f90044d12dbe0979c999265cbe46f267c4c592d | [
"Apache-2.0"
] | 11 | 2021-03-03T07:21:27.000Z | 2022-03-12T01:03:44.000Z | core/controllers/domain_objects_validator_test.py | Tim810306/oppia | 6f90044d12dbe0979c999265cbe46f267c4c592d | [
"Apache-2.0"
] | 1 | 2017-12-06T19:41:49.000Z | 2017-12-06T19:41:49.000Z | # Copyright 2021 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 37.907895 | 91 | 0.585676 |
from __future__ import absolute_import
from __future__ import unicode_literals
from core.controllers import domain_objects_validator
from core.tests import test_utils
import utils
class ValidateExplorationChangeTests(test_utils.GenericTestBase):
def test_incorrect_object_raises_exception(self) -> None:
... | true | true |
1c13dc0d3a4454127d91f31bc3f33a9e0bbbaa07 | 7,628 | py | Python | configs/bead/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco.py | anley1/Swin-Transformer-Object-Detection | 0f26c7979ee2360acd359a5789cd8d52527e0d64 | [
"Apache-2.0"
] | null | null | null | configs/bead/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco.py | anley1/Swin-Transformer-Object-Detection | 0f26c7979ee2360acd359a5789cd8d52527e0d64 | [
"Apache-2.0"
] | null | null | null | configs/bead/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco.py | anley1/Swin-Transformer-Object-Detection | 0f26c7979ee2360acd359a5789cd8d52527e0d64 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/datasets/bead_cropped_type_2_mask.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
checkpoint_config = dict(max_keep_ckpts=4)
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)... | 34.990826 | 79 | 0.469455 | _base_ = [
'../_base_/datasets/bead_cropped_type_2_mask.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
checkpoint_config = dict(max_keep_ckpts=4)
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)... | true | true |
1c13dd5ba4e9b3bce0d48a9177f25f901d00b488 | 3,131 | py | Python | scripts/data_convert/msmarco/convert_pass.py | ankitshah009/FlexNeuART | 041e73e0d557ed677dff7bcf3fa1202d94195b20 | [
"Apache-2.0"
] | null | null | null | scripts/data_convert/msmarco/convert_pass.py | ankitshah009/FlexNeuART | 041e73e0d557ed677dff7bcf3fa1202d94195b20 | [
"Apache-2.0"
] | null | null | null | scripts/data_convert/msmarco/convert_pass.py | ankitshah009/FlexNeuART | 041e73e0d557ed677dff7bcf3fa1202d94195b20 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Convert MSMARCO passage collection
import sys
import json
import argparse
import multiprocessing
import pytorch_pretrained_bert
sys.path.append('.')
from scripts.data_convert.text_proc import SpacyTextParser
from scripts.data_convert.convert_common import STOPWORD_FILE, BERT_TOK_OPT_HELP, BERT... | 33.666667 | 104 | 0.709039 | import sys
import json
import argparse
import multiprocessing
import pytorch_pretrained_bert
sys.path.append('.')
from scripts.data_convert.text_proc import SpacyTextParser
from scripts.data_convert.convert_common import STOPWORD_FILE, BERT_TOK_OPT_HELP, BERT_TOK_OPT, \
FileWrapper, readStopWords, addRetokenizedF... | true | true |
1c13de0e42b9a4320725e62d8eabaf72f2edba9d | 4,786 | py | Python | djstripe/utils.py | appsumo/djstripe | 59e0dbf506cbd59baaca3206a19c07f4307dac35 | [
"MIT"
] | null | null | null | djstripe/utils.py | appsumo/djstripe | 59e0dbf506cbd59baaca3206a19c07f4307dac35 | [
"MIT"
] | null | null | null | djstripe/utils.py | appsumo/djstripe | 59e0dbf506cbd59baaca3206a19c07f4307dac35 | [
"MIT"
] | null | null | null | """
Utility functions related to the djstripe app.
"""
import datetime
import warnings
from typing import Optional
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import ImproperlyConfigured
from django.db.models.query import QuerySet
from django.utils impor... | 31.077922 | 88 | 0.711868 |
import datetime
import warnings
from typing import Optional
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import ImproperlyConfigured
from django.db.models.query import QuerySet
from django.utils import timezone
ANONYMOUS_USER_ERROR_MSG = (
"dj-stripe... | true | true |
1c13defea8978c54aee60a9392918fe0a7b616c8 | 1,086 | py | Python | demo/demo_1_standard_use_case.py | alisure-fork/imgaug | 037abbd0d9f8dd8949c10858bf4aa2f7762c6add | [
"MIT"
] | null | null | null | demo/demo_1_standard_use_case.py | alisure-fork/imgaug | 037abbd0d9f8dd8949c10858bf4aa2f7762c6add | [
"MIT"
] | null | null | null | demo/demo_1_standard_use_case.py | alisure-fork/imgaug | 037abbd0d9f8dd8949c10858bf4aa2f7762c6add | [
"MIT"
] | null | null | null | from imgaug import augmenters as iaa
"""
A standard use case
The following example shows a standard use case.
An augmentation sequence (crop + horizontal flips + gaussian blur) is defined once at the start of the script.
Then many batches are loaded and augmented before being used for training.
https://imgaug.read... | 38.785714 | 111 | 0.720994 | from imgaug import augmenters as iaa
seq = iaa.Sequential([
iaa.Crop(px=(0, 16)), iaa.Fliplr(0.5), iaa.GaussianBlur(sigma=(0, 3.0)) ])
for batch_idx in range(1000):
images = load_batch(batch_idx)
images_aug = seq(images=images)
train_on_images(images_aug)
pass
| true | true |
1c13df1802670b530798ed2b543385e3acb7b7b4 | 1,896 | py | Python | setup.py | alcarney/topos-preview | d572ac3ec65db9dbb329e9fe6441dada6e4aa731 | [
"MIT"
] | null | null | null | setup.py | alcarney/topos-preview | d572ac3ec65db9dbb329e9fe6441dada6e4aa731 | [
"MIT"
] | 5 | 2018-03-25T16:11:46.000Z | 2019-11-12T19:40:09.000Z | setup.py | alcarney/topos-preview | d572ac3ec65db9dbb329e9fe6441dada6e4aa731 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
from subprocess import check_call
class PostInstall(install):
"""Post installation steps.
1. Install the notebook extension using jupyter nbextension install
2. Enable... | 30.095238 | 95 | 0.609177 | from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
from subprocess import check_call
class PostInstall(install):
def run(self):
install.run(self)
check_call(["jupyter", "nbextension", "install"... | true | true |
1c13df3c8acf5ffa1eb2e2d110451ca3065ef9d8 | 276 | py | Python | lib/reportlab/pdfgen/__init__.py | jwheare/digest | 963a0f46862319aa499d4cbbfdbd6380287fc5a5 | [
"BSD-3-Clause"
] | 5 | 2016-05-08T23:51:38.000Z | 2021-05-02T10:09:29.000Z | lib/reportlab/pdfgen/__init__.py | jwheare/digest | 963a0f46862319aa499d4cbbfdbd6380287fc5a5 | [
"BSD-3-Clause"
] | null | null | null | lib/reportlab/pdfgen/__init__.py | jwheare/digest | 963a0f46862319aa499d4cbbfdbd6380287fc5a5 | [
"BSD-3-Clause"
] | 1 | 2018-01-16T16:03:44.000Z | 2018-01-16T16:03:44.000Z | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/__init__.py
__version__=''' $Id: __init__.py 2385 2004-06-17 15:26:05Z rgbecker $ '''
__doc__='' | 55.2 | 108 | 0.76087 | __version__=''' $Id: __init__.py 2385 2004-06-17 15:26:05Z rgbecker $ '''
__doc__='' | true | true |
1c13dfbefaf13ccc855d980aebf3c248cfcaf50a | 1,822 | py | Python | site_scons/site_tools/qt4/test/ts_qm/clean/sconstest-clean.py | mbychawski/traffic-simulator | ef576cb9b2083e9e1cb8671356032d90dcfa42aa | [
"BSD-3-Clause"
] | 14 | 2019-02-28T11:53:35.000Z | 2022-01-11T03:04:53.000Z | site_scons/site_tools/qt4/test/ts_qm/clean/sconstest-clean.py | mbychawski/traffic-simulator | ef576cb9b2083e9e1cb8671356032d90dcfa42aa | [
"BSD-3-Clause"
] | 12 | 2020-02-27T14:27:30.000Z | 2022-03-19T00:10:51.000Z | site_scons/site_tools/qt4/test/ts_qm/clean/sconstest-clean.py | mbychawski/traffic-simulator | ef576cb9b2083e9e1cb8671356032d90dcfa42aa | [
"BSD-3-Clause"
] | 8 | 2018-06-19T03:40:09.000Z | 2022-03-23T17:33:18.000Z | #!/usr/bin/env python
#
# Copyright (c) 2001-2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use,... | 33.127273 | 81 | 0.755214 |
import TestSCons
test = TestSCons.TestSCons()
test.dir_fixture("image")
test.file_fixture('../../qtenv.py')
test.file_fixture('../../../__init__.py','site_scons/site_tools/qt4/__init__.py')
test.run(stderr=None)
test.must_exist(test.workpath('my_en.ts'))
test.must_contain(test.workpath('my_en.ts'),'SCons rocks!')
... | true | true |
1c13dfeb92071915055a7ccdff863bdbc3b1f78b | 2,147 | py | Python | turbinia/jobs/artifact_extraction.py | jorlamd/turbinia | 4f91673855cf8f07b208d1a829b43a1c0aaad1e9 | [
"Apache-2.0"
] | null | null | null | turbinia/jobs/artifact_extraction.py | jorlamd/turbinia | 4f91673855cf8f07b208d1a829b43a1c0aaad1e9 | [
"Apache-2.0"
] | null | null | null | turbinia/jobs/artifact_extraction.py | jorlamd/turbinia | 4f91673855cf8f07b208d1a829b43a1c0aaad1e9 | [
"Apache-2.0"
] | 1 | 2019-10-31T10:16:08.000Z | 2019-10-31T10:16:08.000Z | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 34.079365 | 79 | 0.75687 |
from __future__ import unicode_literals
from turbinia.evidence import Directory
from turbinia.evidence import GoogleCloudDisk
from turbinia.evidence import GoogleCloudDiskRawEmbedded
from turbinia.evidence import ExportedFileArtifact
from turbinia.evidence import RawDisk
from turbinia.evidence import ReportText
from ... | true | true |
1c13e028c09a61ec279914187383ed0e6b3dbbf5 | 13,028 | py | Python | graph2text/onmt/decoders/transformer.py | guanghuixu/kg2text | c70fd9a60b30c5d2136f7a413452e8b550c7b8da | [
"Apache-2.0"
] | null | null | null | graph2text/onmt/decoders/transformer.py | guanghuixu/kg2text | c70fd9a60b30c5d2136f7a413452e8b550c7b8da | [
"Apache-2.0"
] | null | null | null | graph2text/onmt/decoders/transformer.py | guanghuixu/kg2text | c70fd9a60b30c5d2136f7a413452e8b550c7b8da | [
"Apache-2.0"
] | null | null | null | """
Implementation of "Attention is All You Need"
"""
import torch
import torch.nn as nn
from onmt.decoders.decoder import DecoderBase
from onmt.modules import MultiHeadedAttention, AverageAttention
from onmt.modules.position_ffn import PositionwiseFeedForward
from onmt.utils.misc import sequence_mask
from pytorch_tr... | 39.840979 | 85 | 0.590651 |
import torch
import torch.nn as nn
from onmt.decoders.decoder import DecoderBase
from onmt.modules import MultiHeadedAttention, AverageAttention
from onmt.modules.position_ffn import PositionwiseFeedForward
from onmt.utils.misc import sequence_mask
from pytorch_transformers.modeling_bert import BertConfig
from onmt.d... | true | true |
1c13e1ca50f7088f4571ec377e938bdea4a9abc3 | 259 | py | Python | elink/_axi_intf.py | cfelton/parallella_elink | ccd2e7d49cca6cf10ed327aadad2d096e38121eb | [
"MIT"
] | null | null | null | elink/_axi_intf.py | cfelton/parallella_elink | ccd2e7d49cca6cf10ed327aadad2d096e38121eb | [
"MIT"
] | null | null | null | elink/_axi_intf.py | cfelton/parallella_elink | ccd2e7d49cca6cf10ed327aadad2d096e38121eb | [
"MIT"
] | null | null | null |
from myhdl import Signal
from myhdl import ResetSignal
from myhdl import intbv
class AXI(object):
def __init__(self):
pass
class AXIMaster(AXI):
def __init__(self):
pass
class AXISalve(AXI):
def __init__(self):
pass
| 12.95 | 29 | 0.660232 |
from myhdl import Signal
from myhdl import ResetSignal
from myhdl import intbv
class AXI(object):
def __init__(self):
pass
class AXIMaster(AXI):
def __init__(self):
pass
class AXISalve(AXI):
def __init__(self):
pass
| true | true |
1c13e1d0bea94a78a013b2b54f981f6e9f618d30 | 783 | py | Python | keras/2.py | zinderud/ysa | e34d3f4c7afab3976d86f5d27edfcd273414e496 | [
"Apache-2.0"
] | null | null | null | keras/2.py | zinderud/ysa | e34d3f4c7afab3976d86f5d27edfcd273414e496 | [
"Apache-2.0"
] | 1 | 2017-12-27T10:09:22.000Z | 2017-12-27T10:22:47.000Z | keras/2.py | zinderud/ysa | e34d3f4c7afab3976d86f5d27edfcd273414e496 | [
"Apache-2.0"
] | null | null | null | from keras.models import Sequential
model = Sequential()
from keras.layers import Dense, Activation
model.add(Dense(units=64, input_dim=100))
model.add(Activation('relu'))
model.add(Dense(units=10))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='sgd',
... | 29 | 83 | 0.736909 | from keras.models import Sequential
model = Sequential()
from keras.layers import Dense, Activation
model.add(Dense(units=64, input_dim=100))
model.add(Activation('relu'))
model.add(Dense(units=10))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='sgd',
... | true | true |
1c13e21391e4c08a70d429075cb03dc7d315c802 | 987 | py | Python | test/test_edit_contact.py | Gornghost/e.gornysh_python_training | def2a86e7ccb839a8c792ef393300b035e48fa9a | [
"Apache-2.0"
] | null | null | null | test/test_edit_contact.py | Gornghost/e.gornysh_python_training | def2a86e7ccb839a8c792ef393300b035e48fa9a | [
"Apache-2.0"
] | null | null | null | test/test_edit_contact.py | Gornghost/e.gornysh_python_training | def2a86e7ccb839a8c792ef393300b035e48fa9a | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
import random
def test_edit_contact_general_info(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create_contact(Contact(first_name="TEST"))
old_contact_list = db.get_contact_list()
contact = random.choice(old_contact_list)
new_contact_data ... | 51.947368 | 127 | 0.745694 | from model.contact import Contact
import random
def test_edit_contact_general_info(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create_contact(Contact(first_name="TEST"))
old_contact_list = db.get_contact_list()
contact = random.choice(old_contact_list)
new_contact_data ... | true | true |
1c13e35b1bcc458e8278cd23e36274f7f12af4fb | 1,029 | py | Python | doc/examples/parametrized.py | celeraone/pytest-dependency | 8c69383cfb8df47467071ee10af83b60e67616c0 | [
"Apache-2.0"
] | 1 | 2018-07-17T13:35:40.000Z | 2018-07-17T13:35:40.000Z | doc/examples/parametrized.py | celeraone/pytest-dependency | 8c69383cfb8df47467071ee10af83b60e67616c0 | [
"Apache-2.0"
] | null | null | null | doc/examples/parametrized.py | celeraone/pytest-dependency | 8c69383cfb8df47467071ee10af83b60e67616c0 | [
"Apache-2.0"
] | 1 | 2018-12-01T16:52:17.000Z | 2018-12-01T16:52:17.000Z | import pytest
@pytest.mark.parametrize("x,y", [
pytest.mark.dependency(name="a1")((0,0)),
pytest.mark.dependency(name="a2")(pytest.mark.xfail((0,1))),
pytest.mark.dependency(name="a3")((1,0)),
pytest.mark.dependency(name="a4")((1,1))
])
def test_a(x,y):
assert y <= x
@pytest.mark.parametrize("u,v"... | 34.3 | 69 | 0.591837 | import pytest
@pytest.mark.parametrize("x,y", [
pytest.mark.dependency(name="a1")((0,0)),
pytest.mark.dependency(name="a2")(pytest.mark.xfail((0,1))),
pytest.mark.dependency(name="a3")((1,0)),
pytest.mark.dependency(name="a4")((1,1))
])
def test_a(x,y):
assert y <= x
@pytest.mark.parametrize("u,v"... | true | true |
1c13e3ae347b4694541b879d830888cae12d7ec0 | 3,762 | py | Python | test/algorithms/ground_state_solvers/minimum_eigensolver_factories/test_vqe_ucc_factory.py | divshacker/qiskit-nature | 08f6dcec5e4ac8c08f5b84e764ee78cc3d12facb | [
"Apache-2.0"
] | 132 | 2021-01-28T14:51:11.000Z | 2022-03-25T21:10:47.000Z | test/algorithms/ground_state_solvers/minimum_eigensolver_factories/test_vqe_ucc_factory.py | divshacker/qiskit-nature | 08f6dcec5e4ac8c08f5b84e764ee78cc3d12facb | [
"Apache-2.0"
] | 449 | 2021-01-28T19:57:43.000Z | 2022-03-31T17:01:50.000Z | test/algorithms/ground_state_solvers/minimum_eigensolver_factories/test_vqe_ucc_factory.py | divshacker/qiskit-nature | 08f6dcec5e4ac8c08f5b84e764ee78cc3d12facb | [
"Apache-2.0"
] | 109 | 2021-01-28T13:17:46.000Z | 2022-03-30T23:53:39.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 39.1875 | 96 | 0.710792 |
import unittest
from test import QiskitNatureTestCase
from qiskit import BasicAer
from qiskit.utils import QuantumInstance
from qiskit.opflow import AerPauliExpectation
from qiskit.algorithms.optimizers import COBYLA
from qiskit_nature.circuit.library import HartreeFock, UCCSD
from qiskit_nature.converters.second_q... | true | true |
1c13e3e58d6076096c62aed4502be11937ff1dd5 | 12,992 | py | Python | ib_insync/util.py | jseparovic/ib_insync | fc85fb0181b358115fdae86ab16dceb9dc3590bd | [
"BSD-2-Clause"
] | 1 | 2018-08-05T01:51:46.000Z | 2018-08-05T01:51:46.000Z | ib_insync/util.py | jseparovic/ib_insync | fc85fb0181b358115fdae86ab16dceb9dc3590bd | [
"BSD-2-Clause"
] | null | null | null | ib_insync/util.py | jseparovic/ib_insync | fc85fb0181b358115fdae86ab16dceb9dc3590bd | [
"BSD-2-Clause"
] | null | null | null | import datetime
import logging
import sys
import math
import signal
import asyncio
import time
from typing import List, Iterator
from collections.abc import Awaitable
from ib_insync.objects import Object, DynamicObject
def df(objs, labels=None):
"""
Create pandas DataFrame from the sequence of same-type obje... | 28.060475 | 76 | 0.606219 | import datetime
import logging
import sys
import math
import signal
import asyncio
import time
from typing import List, Iterator
from collections.abc import Awaitable
from ib_insync.objects import Object, DynamicObject
def df(objs, labels=None):
import pandas as pd
if objs:
objs = list(objs)
... | true | true |
1c13e5771f6c75098e2efeb03fe1401296d5e5db | 21,339 | py | Python | src/keri/core/scheming.py | SmithSamuelM/keripy-wot | ec329f4e011026d655bf46d269792ac97f23276d | [
"Apache-2.0"
] | null | null | null | src/keri/core/scheming.py | SmithSamuelM/keripy-wot | ec329f4e011026d655bf46d269792ac97f23276d | [
"Apache-2.0"
] | null | null | null | src/keri/core/scheming.py | SmithSamuelM/keripy-wot | ec329f4e011026d655bf46d269792ac97f23276d | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
keri.core.scheming module
self-addressing and schema support
"""
import json
import cbor2 as cbor
import jsonschema
import msgpack
from . import coring
from .coring import MtrDex, Serials, Saider, Ids
from .. import help
from ..kering import ValidationError, DeserializationError
logge... | 47.952809 | 1,322 | 0.514785 |
import json
import cbor2 as cbor
import jsonschema
import msgpack
from . import coring
from .coring import MtrDex, Serials, Saider, Ids
from .. import help
from ..kering import ValidationError, DeserializationError
logger = help.ogler.getLogger()
QualifiedVLEIIssuerVLEICredential = "ESAItgWbOyCvcNAqkJFBZqxG2-h69fO... | true | true |
1c13e62fe845471cde9b1c562304a169b8a7572c | 62,518 | py | Python | kicost/kicost_gui.py | INTI-CMNB/KiCost | 5eef5c4aabc2b555ec4cbb22da7613b3c2c17f9a | [
"MIT"
] | null | null | null | kicost/kicost_gui.py | INTI-CMNB/KiCost | 5eef5c4aabc2b555ec4cbb22da7613b3c2c17f9a | [
"MIT"
] | null | null | null | kicost/kicost_gui.py | INTI-CMNB/KiCost | 5eef5c4aabc2b555ec4cbb22da7613b3c2c17f9a | [
"MIT"
] | 1 | 2022-01-06T16:46:45.000Z | 2022-01-06T16:46:45.000Z | # -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corporation / Hildo Guillardi Júnior
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including wit... | 49.97442 | 158 | 0.616207 |
__author__ = 'Hildo Guillardi Júnior'
__webpage__ = 'https://github.com/hildogjr/'
__company__ = 'University of Campinas - Brazil'
from .global_vars import (wxPythonNotPresent, PLATFORM_MACOS_STARTS_WITH, PLATFORM_LINUX_STARTS_WITH, PLATFORM_WINDOWS_STARTS_WITH,
DEBUG_OVERVIEW, DEBUG_OBSESS... | true | true |
1c13e64266dfbb7d662d8dc0ddfc5df3b7bd9dd2 | 1,809 | py | Python | collation/test2.py | enabling-languages/dinka | 981ffd07e7468f692c4d17472083a3c5485987f8 | [
"MIT"
] | 1 | 2018-11-13T13:34:58.000Z | 2018-11-13T13:34:58.000Z | collation/test2.py | enabling-languages/dinka | 981ffd07e7468f692c4d17472083a3c5485987f8 | [
"MIT"
] | 6 | 2018-07-18T23:50:31.000Z | 2021-08-24T06:57:49.000Z | collation/test2.py | enabling-languages/dinka | 981ffd07e7468f692c4d17472083a3c5485987f8 | [
"MIT"
] | null | null | null | import pandas as pd
from icu import Collator, Locale, RuleBasedCollator
ddf = pd.read_csv("../word_frequency/unilex/din.txt", sep='\t', skiprows = range(2,5))
collator = Collator.createInstance(Locale('en_AU.UTF-8'))
# https://stackoverflow.com/questions/13838405/custom-sorting-in-pandas-dataframe/27009771#27009771
... | 37.6875 | 459 | 0.655611 | import pandas as pd
from icu import Collator, Locale, RuleBasedCollator
ddf = pd.read_csv("../word_frequency/unilex/din.txt", sep='\t', skiprows = range(2,5))
collator = Collator.createInstance(Locale('en_AU.UTF-8'))
def sort_pd(key=None,reverse=False):
def sorter(series):
series_list = list(series)
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.