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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c343ec8d7406166f1473bdd9c9d642b8f2b9fdb | 4,027 | py | Python | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 10 | 2019-05-11T18:07:14.000Z | 2021-08-20T03:02:47.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 1 | 2020-07-10T08:25:36.000Z | 2020-07-10T08:25:36.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/french/timeperiod_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 18 | 2019-08-19T12:11:00.000Z | 2021-10-12T09:36:27.000Z | from typing import Pattern, Dict
from recognizers_text.utilities import RegExpUtility
from recognizers_text.extractor import Extractor
from recognizers_number.number.french.extractors import FrenchIntegerExtractor
from ...resources.french_date_time import FrenchDateTime
from ..extractors import DateTimeExtractor
from ... | 36.279279 | 112 | 0.6963 | from typing import Pattern, Dict
from recognizers_text.utilities import RegExpUtility
from recognizers_text.extractor import Extractor
from recognizers_number.number.french.extractors import FrenchIntegerExtractor
from ...resources.french_date_time import FrenchDateTime
from ..extractors import DateTimeExtractor
from ... | true | true |
1c343f0558d28063ad73e27bd3bc87fab9203ce6 | 1,016 | py | Python | main.py | angie1148/eciespy-demo | 021a20c827e354d858a6d3df376e657695b37f44 | [
"MIT"
] | 1 | 2020-06-28T11:42:24.000Z | 2020-06-28T11:42:24.000Z | main.py | angie1148/eciespy-demo | 021a20c827e354d858a6d3df376e657695b37f44 | [
"MIT"
] | null | null | null | main.py | angie1148/eciespy-demo | 021a20c827e354d858a6d3df376e657695b37f44 | [
"MIT"
] | 2 | 2020-06-28T11:54:29.000Z | 2021-09-13T04:38:50.000Z | from typing import Optional
from ecies import decrypt
from ecies import encrypt
from fastapi import FastAPI
from fastapi import Form
from fastapi import HTTPException
from fastapi.responses import Response
app = FastAPI()
def resp_string(msg):
return Response(content=msg, media_type="plain/text")
@app.post("/... | 27.459459 | 78 | 0.669291 | from typing import Optional
from ecies import decrypt
from ecies import encrypt
from fastapi import FastAPI
from fastapi import Form
from fastapi import HTTPException
from fastapi.responses import Response
app = FastAPI()
def resp_string(msg):
return Response(content=msg, media_type="plain/text")
@app.post("/... | true | true |
1c343f3fa0f6f5b05faa870617a0bb83679f92a3 | 2,207 | py | Python | src/openpersonen/contrib/stufbg/migrations/0004_auto_20210423_1630.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 2 | 2020-08-26T11:24:43.000Z | 2021-07-28T09:46:40.000Z | src/openpersonen/contrib/stufbg/migrations/0004_auto_20210423_1630.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 153 | 2020-08-26T10:45:35.000Z | 2021-12-10T17:33:16.000Z | src/openpersonen/contrib/stufbg/migrations/0004_auto_20210423_1630.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.15 on 2021-04-23 14:30
from django.db import migrations, models
import privates.fields
import privates.storages
class Migration(migrations.Migration):
dependencies = [
("stufbg", "0003_auto_20201117_1144"),
]
operations = [
migrations.AlterField(
mo... | 32.940299 | 128 | 0.541459 |
from django.db import migrations, models
import privates.fields
import privates.storages
class Migration(migrations.Migration):
dependencies = [
("stufbg", "0003_auto_20201117_1144"),
]
operations = [
migrations.AlterField(
model_name="stufbgclient",
name="certi... | true | true |
1c343f547503127839b2c17e3dc088729b3ee75b | 2,788 | py | Python | tests/ext_appengine/test_ndb.py | koodaa-team/wtforms | 02de06b54be4ee4cb5787c7946d765ff5211b430 | [
"BSD-3-Clause"
] | 1 | 2022-02-17T20:02:11.000Z | 2022-02-17T20:02:11.000Z | tests/ext_appengine/test_ndb.py | koodaa-team/wtforms | 02de06b54be4ee4cb5787c7946d765ff5211b430 | [
"BSD-3-Clause"
] | null | null | null | tests/ext_appengine/test_ndb.py | koodaa-team/wtforms | 02de06b54be4ee4cb5787c7946d765ff5211b430 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
# This needs to stay as the first import, it sets up paths.
from gaetest_common import DummyPostData, fill_authors
from google.appengine.ext import ndb
from unittest import TestCase
from wtforms import Form, TextField, IntegerField, BooleanField
from wtforms.compat import text_... | 34.419753 | 115 | 0.675036 | from __future__ import unicode_literals
from gaetest_common import DummyPostData, fill_authors
from google.appengine.ext import ndb
from unittest import TestCase
from wtforms import Form, TextField, IntegerField, BooleanField
from wtforms.compat import text_type
from wtforms.ext.appengine.fields import KeyPropertyFi... | false | true |
1c343fc9ce308e57dd6611549a4cce4eadd6b1a8 | 569 | py | Python | examples/1_simple_script/school_demand.py | culebron/erde | 9bbaaa1df46629a182c355413a120aa33dc6b377 | [
"BSD-3-Clause"
] | 16 | 2021-08-24T05:59:04.000Z | 2021-11-16T12:30:34.000Z | examples/1_simple_script/school_demand.py | culebron/erde | 9bbaaa1df46629a182c355413a120aa33dc6b377 | [
"BSD-3-Clause"
] | null | null | null | examples/1_simple_script/school_demand.py | culebron/erde | 9bbaaa1df46629a182c355413a120aa33dc6b377 | [
"BSD-3-Clause"
] | 2 | 2021-08-30T10:27:13.000Z | 2021-08-31T09:46:49.000Z | from erde import read_df, write_df
from erde.op import sjoin, buffer
houses_df = read_df('houses.csv')
schools_df = read_df('schools.csv')
schools_df['school'] = schools_df.index.tolist()
school_buf = buffer.main(schools_df.geometry, 1000, default_crs=4326)
demand = sjoin.sagg(houses_df, schools_df, {'school': 'count... | 33.470588 | 84 | 0.757469 | from erde import read_df, write_df
from erde.op import sjoin, buffer
houses_df = read_df('houses.csv')
schools_df = read_df('schools.csv')
schools_df['school'] = schools_df.index.tolist()
school_buf = buffer.main(schools_df.geometry, 1000, default_crs=4326)
demand = sjoin.sagg(houses_df, schools_df, {'school': 'count... | true | true |
1c3441dc3d6dbd427623f915beacb0d55c67e152 | 6,491 | py | Python | wmb.py | cimini-tech/wmb | 94000cd2a0971e25d437879429759fc57704df8f | [
"MIT"
] | null | null | null | wmb.py | cimini-tech/wmb | 94000cd2a0971e25d437879429759fc57704df8f | [
"MIT"
] | null | null | null | wmb.py | cimini-tech/wmb | 94000cd2a0971e25d437879429759fc57704df8f | [
"MIT"
] | null | null | null | source_folder = "publish/"
destination_folder = "html/"
template_folder = "parts/"
aside_folder = "aside/"
page_header = "header.html"
page_footer = "footer.html"
index_header_file = "index_header.html"
html_ext = ".html"
import os
import re
from datetime import datetime
from shutil import move, copy2
from html.parser... | 34.343915 | 123 | 0.665075 | source_folder = "publish/"
destination_folder = "html/"
template_folder = "parts/"
aside_folder = "aside/"
page_header = "header.html"
page_footer = "footer.html"
index_header_file = "index_header.html"
html_ext = ".html"
import os
import re
from datetime import datetime
from shutil import move, copy2
from html.parser... | true | true |
1c344437850de447a32479ca19b9ab57140a6b25 | 4,303 | py | Python | src/scout_apm/core/context.py | tony/scout_apm_python | f477b09b1ef6e644980130d4d44954f27570ada2 | [
"MIT"
] | 60 | 2018-04-15T04:09:39.000Z | 2022-03-29T12:10:40.000Z | src/scout_apm/core/context.py | tony/scout_apm_python | f477b09b1ef6e644980130d4d44954f27570ada2 | [
"MIT"
] | 326 | 2018-03-28T16:09:13.000Z | 2022-03-03T13:50:23.000Z | src/scout_apm/core/context.py | tony/scout_apm_python | f477b09b1ef6e644980130d4d44954f27570ada2 | [
"MIT"
] | 25 | 2018-05-30T17:59:46.000Z | 2022-02-24T19:40:02.000Z | # coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import threading
import time
from threading import local as ThreadLocal
from scout_apm.core.tracked_request import TrackedRequest
try:
from asgiref.local import Local as AsgiRefLocal
except ImportError:
# Old ve... | 30.302817 | 83 | 0.62654 |
from __future__ import absolute_import, division, print_function, unicode_literals
import threading
import time
from threading import local as ThreadLocal
from scout_apm.core.tracked_request import TrackedRequest
try:
from asgiref.local import Local as AsgiRefLocal
except ImportError:
AsgiRefLocal = No... | true | true |
1c3444983478f7ee55cc4aec280838b76375b3dc | 363 | py | Python | cv-api/app/cam/ICamera.py | TheLongRunSmoke/birdfeeder | 6f238c9b8c8abdc866aaf042f79b674714fdaa8c | [
"MIT"
] | null | null | null | cv-api/app/cam/ICamera.py | TheLongRunSmoke/birdfeeder | 6f238c9b8c8abdc866aaf042f79b674714fdaa8c | [
"MIT"
] | 1 | 2017-11-28T04:26:45.000Z | 2017-11-28T04:57:47.000Z | cv-api/app/cam/ICamera.py | TheLongRunSmoke/birdfeeder | 6f238c9b8c8abdc866aaf042f79b674714fdaa8c | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
class ICamera:
__metaclass__ = ABCMeta
@abstractmethod
def retrieve(self):
"""Return next frame from camera."""
@abstractmethod
def auto_exposure(self, frame):
"""Calculate and set exposure."""
@abstractmethod
def get_exposure(sel... | 20.166667 | 44 | 0.650138 | from abc import ABCMeta, abstractmethod
class ICamera:
__metaclass__ = ABCMeta
@abstractmethod
def retrieve(self):
@abstractmethod
def auto_exposure(self, frame):
@abstractmethod
def get_exposure(self):
| true | true |
1c3444a9a1f2938fa8cc9e71aba3bb3f78c33aba | 1,353 | py | Python | medium/31_next_permutation.py | czla/leetcode-solution | bee4bc1588b270ca580199d23ab83c939b7e17b8 | [
"MIT"
] | 3 | 2019-05-01T08:23:37.000Z | 2019-08-03T01:35:28.000Z | medium/31_next_permutation.py | czla/leetcode-solution | bee4bc1588b270ca580199d23ab83c939b7e17b8 | [
"MIT"
] | null | null | null | medium/31_next_permutation.py | czla/leetcode-solution | bee4bc1588b270ca580199d23ab83c939b7e17b8 | [
"MIT"
] | null | null | null | # Description: 实现获取下一个排列的函数,算法需要将给定数字序列重新排列成字典序中下一个更大的排列。
#
# 如果不存在下一个更大的排列,则将数字重新排列成最小的排列(即升序排列)。
#
# 必须原地修改,只允许使用额外常数空间。
#
#
#
# Examples: 输入: [1,2,3] 输出:[1,3,2]
# 输入: [3,2,1] 输出:[1,2,3]
# 输入: [1,1,5] 输出:[1,5,1]
#
# Difficulty: Medium
# Aut... | 29.413043 | 93 | 0.524021 |
class Solution:
def nextPermutation(self, nums) -> None:
length = len(nums)
if length < 2:
return
# find the first pair, where n[index-1] <= n[index]
index = -1
while (nums[index] <= nums[index - 1]):
index -= 1
if index ... | true | true |
1c3444df9ee7708900b28d2f1be7d4b3cbd23113 | 604 | py | Python | 01_Python by Example Learning to Program in 150 Challenges by Nichola Lacey/07_chapter seven Random/problem54.py | Magdyedwar1996/python-level-one-codes | 066086672f43488bc8b32c620b5e2f94cedfe3da | [
"MIT"
] | 1 | 2021-11-16T14:14:38.000Z | 2021-11-16T14:14:38.000Z | 01_Python by Example Learning to Program in 150 Challenges by Nichola Lacey/07_chapter seven Random/problem54.py | Magdyedwar1996/python-level-one-codes | 066086672f43488bc8b32c620b5e2f94cedfe3da | [
"MIT"
] | null | null | null | 01_Python by Example Learning to Program in 150 Challenges by Nichola Lacey/07_chapter seven Random/problem54.py | Magdyedwar1996/python-level-one-codes | 066086672f43488bc8b32c620b5e2f94cedfe3da | [
"MIT"
] | null | null | null | """
054
Randomly choose either heads or tails (“h” or “t”). Ask
the user to make their choice. If their choice is the same
as the randomly selected value, display the message
“You win”, otherwise display “Bad luck”. At the end, tell
the user if the computer selected heads or tails.
"""
import random
heads_or_tails = ["... | 31.789474 | 58 | 0.690397 | import random
heads_or_tails = ["h","t"]
while 1 :
computer_choice = random.choice(heads_or_tails)
user_choice = input("Choose either head or tail : ")
if computer_choice == user_choice:
print("You win ")
else :
print("Bad luck ")
print("the computer chose ",computer_choice+"\n") | true | true |
1c34455d3c27bc9b9d5d46870aab6fd77a15f7e4 | 13,744 | py | Python | reframe/core/runtime.py | Lumi-supercomputer/reframe | f1e46807663db0b4f7e6b1252c4fcda6fbcc3270 | [
"BSD-3-Clause"
] | null | null | null | reframe/core/runtime.py | Lumi-supercomputer/reframe | f1e46807663db0b4f7e6b1252c4fcda6fbcc3270 | [
"BSD-3-Clause"
] | 3 | 2022-03-11T09:51:33.000Z | 2022-03-31T08:20:19.000Z | reframe/core/runtime.py | Lumi-supercomputer/reframe | f1e46807663db0b4f7e6b1252c4fcda6fbcc3270 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Handling of the current host context
#
import os
import functools
from datetime import datetime
import reframe.core.conf... | 29.304904 | 78 | 0.596333 |
import os
import functools
from datetime import datetime
import reframe.core.config as config
import reframe.utility.osext as osext
from reframe.core.environments import (Environment, snapshot)
from reframe.core.exceptions import ReframeFatalError
from reframe.core.logging import getlogger
from reframe.core.s... | true | true |
1c3445a2e6767a3749a48932c05f9b500fc7368f | 256 | py | Python | tomolab/ScannerGeometries/__init__.py | TomographyLab/TomoLab | 86b9a5894ef1660d7f4de39f560f1f92024b40f8 | [
"Apache-2.0"
] | 5 | 2019-06-01T13:16:00.000Z | 2022-03-02T10:21:59.000Z | tomolab/ScannerGeometries/__init__.py | TomographyLab/TomoLab | 86b9a5894ef1660d7f4de39f560f1f92024b40f8 | [
"Apache-2.0"
] | null | null | null | tomolab/ScannerGeometries/__init__.py | TomographyLab/TomoLab | 86b9a5894ef1660d7f4de39f560f1f92024b40f8 | [
"Apache-2.0"
] | 1 | 2019-06-01T13:19:18.000Z | 2019-06-01T13:19:18.000Z | # -*- coding: utf-8 -*-
# tomolab
# Michele Scipioni
# Harvard University, Martinos Center for Biomedical Imaging
# University of Pisa
__all__ = ['Siemens_Biograph_mMR', 'GE_Discovery_RX']
from . import Siemens_Biograph_mMR
from . import GE_Discovery_RX
| 23.272727 | 60 | 0.765625 |
__all__ = ['Siemens_Biograph_mMR', 'GE_Discovery_RX']
from . import Siemens_Biograph_mMR
from . import GE_Discovery_RX
| true | true |
1c34466bdecf6638f5d8bace2d07c85114ab8cec | 459 | py | Python | articleapp/models.py | wkd-woo/RecommendMovie | ae5507f6466c417e48ff4769a7968082c014da11 | [
"MIT"
] | 2 | 2021-05-05T08:36:37.000Z | 2021-05-09T13:01:32.000Z | articleapp/models.py | wkd-woo/RecommendMovie | ae5507f6466c417e48ff4769a7968082c014da11 | [
"MIT"
] | null | null | null | articleapp/models.py | wkd-woo/RecommendMovie | ae5507f6466c417e48ff4769a7968082c014da11 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.db import models
# Create your models here.
class Article(models.Model):
writer = models.ForeignKey(User, on_delete=models.SET_NULL, related_name='article', null=True)
title = models.CharField(max_length=200, null=True)
image = models.ImageField(up... | 30.6 | 98 | 0.753813 | from django.contrib.auth.models import User
from django.db import models
class Article(models.Model):
writer = models.ForeignKey(User, on_delete=models.SET_NULL, related_name='article', null=True)
title = models.CharField(max_length=200, null=True)
image = models.ImageField(upload_to='article/', null=F... | true | true |
1c344692d6a25c29742187b7cf37f00b9ad1881f | 5,594 | py | Python | awx/main/models/activity_stream.py | withshubh/awx | 38f3176221fe6981f38931d050705b736ea89fdc | [
"Apache-2.0"
] | 2 | 2021-03-18T11:08:15.000Z | 2021-03-19T09:20:27.000Z | awx/main/models/activity_stream.py | withshubh/awx | 38f3176221fe6981f38931d050705b736ea89fdc | [
"Apache-2.0"
] | 24 | 2021-04-01T08:33:08.000Z | 2022-03-01T21:13:06.000Z | awx/main/models/activity_stream.py | it-baschtler/awx | 8ba9eef97b4f9ab707f31538874b37e8d1a5b525 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Tower
from awx.api.versioning import reverse
from awx.main.fields import JSONField
from awx.main.models.base import accepts_json
# Django
from django.db import models
from django.conf import settings
from django.utils.encoding import smart_str
from django.ut... | 45.479675 | 140 | 0.712907 |
from awx.api.versioning import reverse
from awx.main.fields import JSONField
from awx.main.models.base import accepts_json
from django.db import models
from django.conf import settings
from django.utils.encoding import smart_str
from django.utils.translation import ugettext_lazy as _
__all__ = ['ActivityStream']... | true | true |
1c3446bbf83437a2b59dbe0b68646890b07f5470 | 7,790 | py | Python | docs/conf.py | charlos1204/sabrina_test | b3d840b9fd2d42c4bd9c0eae4a1c294555171e3a | [
"RSA-MD"
] | null | null | null | docs/conf.py | charlos1204/sabrina_test | b3d840b9fd2d42c4bd9c0eae4a1c294555171e3a | [
"RSA-MD"
] | null | null | null | docs/conf.py | charlos1204/sabrina_test | b3d840b9fd2d42c4bd9c0eae4a1c294555171e3a | [
"RSA-MD"
] | null | null | null | # -*- coding: utf-8 -*-
#
# sabrina_test documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values h... | 31.795918 | 80 | 0.707702 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'sabrina_test'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# Th... | true | true |
1c3447258842c979c163cd20706019dc302914bf | 7,581 | py | Python | tdc3/models/py/data/FunctionNameConsistencyDataset.py | TDC3Tool/TDC3 | c746d8e89c0eb35cc3d1b73f469a9f89f5e7bbfd | [
"MIT"
] | null | null | null | tdc3/models/py/data/FunctionNameConsistencyDataset.py | TDC3Tool/TDC3 | c746d8e89c0eb35cc3d1b73f469a9f89f5e7bbfd | [
"MIT"
] | null | null | null | tdc3/models/py/data/FunctionNameConsistencyDataset.py | TDC3Tool/TDC3 | c746d8e89c0eb35cc3d1b73f469a9f89f5e7bbfd | [
"MIT"
] | null | null | null | import random
import torch as t
from py.data.XYDataset import XYDataset
from py.util.Config import dtype, device, en_stops
from nltk.tokenize import word_tokenize
import numpy as np
def genericDescriptionClassifier(description, embedding):
some_generic_descriptions = ['work', 'success', 'test', 'filter',
... | 43.568966 | 126 | 0.64965 | import random
import torch as t
from py.data.XYDataset import XYDataset
from py.util.Config import dtype, device, en_stops
from nltk.tokenize import word_tokenize
import numpy as np
def genericDescriptionClassifier(description, embedding):
some_generic_descriptions = ['work', 'success', 'test', 'filter',
... | true | true |
1c344732e5c723a7e896560c0d04766385a5d092 | 201 | py | Python | Week 5/Lecture 9 - Efficiency and Orders of Growth/In-Video Problems/Lec9.2Slide2.py | roshanM99/edX--mitX--introduction-to-computer-science-and-programming-with-python | 81a7247e8442feddd624b5dbcd70cde1b58d2965 | [
"MIT"
] | null | null | null | Week 5/Lecture 9 - Efficiency and Orders of Growth/In-Video Problems/Lec9.2Slide2.py | roshanM99/edX--mitX--introduction-to-computer-science-and-programming-with-python | 81a7247e8442feddd624b5dbcd70cde1b58d2965 | [
"MIT"
] | null | null | null | Week 5/Lecture 9 - Efficiency and Orders of Growth/In-Video Problems/Lec9.2Slide2.py | roshanM99/edX--mitX--introduction-to-computer-science-and-programming-with-python | 81a7247e8442feddd624b5dbcd70cde1b58d2965 | [
"MIT"
] | null | null | null | # Lecture 9.2, slide 2
def f(x):
for i in range(1000):
ans = i
for i in range(x):
ans += 1
for i in range(x):
for j in range(x):
ans += 1
return ans | 18.272727 | 26 | 0.457711 |
def f(x):
for i in range(1000):
ans = i
for i in range(x):
ans += 1
for i in range(x):
for j in range(x):
ans += 1
return ans | true | true |
1c34479a78d8bad008e561dc974b9c0fdb23c85a | 2,639 | py | Python | encodings/hp_roman8.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | 1 | 2020-03-12T16:44:10.000Z | 2020-03-12T16:44:10.000Z | encodings/hp_roman8.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | encodings/hp_roman8.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: encodings.hp_roman8
import codecs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charm... | 19.404412 | 223 | 0.594164 |
import codecs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_map)
def decode(self, input, errors='strict'):
return codecs.charmap_decode(input, errors, decoding_map)
class IncrementalEncoder(codecs.IncrementalEnc... | true | true |
1c34479adff6a45dc6ea14c7d57795f293fd8a8e | 399 | py | Python | onmt/encoders/__init__.py | philhchen/OpenNMT-evidential-softmax | 87709ce1cf7bda783aed4a64c096fa23282e7aa9 | [
"MIT"
] | null | null | null | onmt/encoders/__init__.py | philhchen/OpenNMT-evidential-softmax | 87709ce1cf7bda783aed4a64c096fa23282e7aa9 | [
"MIT"
] | null | null | null | onmt/encoders/__init__.py | philhchen/OpenNMT-evidential-softmax | 87709ce1cf7bda783aed4a64c096fa23282e7aa9 | [
"MIT"
] | null | null | null | """Module defining encoders."""
from onmt.encoders.encoder import EncoderBase
from onmt.encoders.transformer import TransformerEncoder
from onmt.encoders.rnn_encoder import RNNEncoder
from onmt.encoders.cnn_encoder import CNNEncoder
from onmt.encoders.mean_encoder import MeanEncoder
__all__ = [
"EncoderBase",
... | 26.6 | 56 | 0.779449 | from onmt.encoders.encoder import EncoderBase
from onmt.encoders.transformer import TransformerEncoder
from onmt.encoders.rnn_encoder import RNNEncoder
from onmt.encoders.cnn_encoder import CNNEncoder
from onmt.encoders.mean_encoder import MeanEncoder
__all__ = [
"EncoderBase",
"TransformerEncoder",
"RNNEn... | true | true |
1c3447ef6cb0d182f4ceaf86c91f75002f05e23d | 137,113 | py | Python | goodies/ospexporter/import_fbx.py | Ghimli/new-ospgl | 31bd84e52d954683671211ff16ce8702bdb87312 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | goodies/ospexporter/import_fbx.py | Ghimli/new-ospgl | 31bd84e52d954683671211ff16ce8702bdb87312 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | goodies/ospexporter/import_fbx.py | Ghimli/new-ospgl | 31bd84e52d954683671211ff16ce8702bdb87312 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 43.090195 | 157 | 0.600672 | lem,
)
from .fbx_utils import (
PerfMon,
units_blender_to_fbx_factor,
units_convertor_iter,
array_to_matrix4,
similar_values,
similar_values_iter,
FBXImportSettings,
)
fbx_elem_nil = None
convert_deg_to_rad_iter = units_convertor_iter("degree", "radian")
MAT_CONVERT_BONE = fbx_utils.MAT... | true | true |
1c3448577386eda5a0b2ccf0122ca2762a88e024 | 414 | py | Python | quokka/utils/translation.py | mysky528/quokka | d2c3c169f6b78cace154274747297f8e1dc56825 | [
"MIT"
] | null | null | null | quokka/utils/translation.py | mysky528/quokka | d2c3c169f6b78cace154274747297f8e1dc56825 | [
"MIT"
] | null | null | null | quokka/utils/translation.py | mysky528/quokka | d2c3c169f6b78cace154274747297f8e1dc56825 | [
"MIT"
] | null | null | null | from flask import g
from babel.support import LazyProxy
from flask_babelex import gettext, lazy_gettext, ngettext
# from quokka.utils.translations import ugettext_lazy as _
def ugettext(s):
# we assume a before_request function
# assigns the correct user-specific
# translations
return g.translations.... | 21.789474 | 58 | 0.772947 | from flask import g
from babel.support import LazyProxy
from flask_babelex import gettext, lazy_gettext, ngettext
def ugettext(s):
return g.translations.ugettext(s)
ugettext_lazy = LazyProxy(ugettext)
_ = gettext
_l = lazy_gettext
_n = ngettext
| true | true |
1c344920d95c5e1359987c32f63769ecf95ca103 | 4,388 | py | Python | project/migrations/0001_initial.py | developerayyo/projectx | 5f67502cb96ac3bc59031d48440982b1c217d535 | [
"MIT"
] | null | null | null | project/migrations/0001_initial.py | developerayyo/projectx | 5f67502cb96ac3bc59031d48440982b1c217d535 | [
"MIT"
] | null | null | null | project/migrations/0001_initial.py | developerayyo/projectx | 5f67502cb96ac3bc59031d48440982b1c217d535 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-14 19:17
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('aut... | 58.506667 | 329 | 0.628304 |
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
... | true | true |
1c3449c19d9db174777b8c944dcf2839d91a05c4 | 555 | py | Python | manage.py | JennyRemolina/api-projex | 9c34a7dc0036c09215a15b9e1ad59dd025ef2705 | [
"MIT"
] | 1 | 2019-05-31T04:40:09.000Z | 2019-05-31T04:40:09.000Z | manage.py | JennyRemolina/api-projex | 9c34a7dc0036c09215a15b9e1ad59dd025ef2705 | [
"MIT"
] | 4 | 2020-06-05T20:41:34.000Z | 2021-09-08T00:58:10.000Z | manage.py | JennyRemolina/api-projex | 9c34a7dc0036c09215a15b9e1ad59dd025ef2705 | [
"MIT"
] | 3 | 2019-05-31T04:40:04.000Z | 2020-02-08T21:54:23.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'projexbackend.config.development')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't imp... | 34.6875 | 87 | 0.693694 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'projexbackend.config.development')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you s... | true | true |
1c344a24eb5a6f062aeec960eb783508f8f251c8 | 45 | py | Python | test/login.py | Super-ye/yeye | 11515021d837812bf816dcb08f0f965736863d75 | [
"MIT"
] | null | null | null | test/login.py | Super-ye/yeye | 11515021d837812bf816dcb08f0f965736863d75 | [
"MIT"
] | null | null | null | test/login.py | Super-ye/yeye | 11515021d837812bf816dcb08f0f965736863d75 | [
"MIT"
] | null | null | null | num1 = 10
num2 = 20
num3 = 300
num3 = 40
| 5 | 10 | 0.555556 | num1 = 10
num2 = 20
num3 = 300
num3 = 40
| true | true |
1c344a958ffe3e6892f6de64738dce43a9ec63e1 | 327 | py | Python | setup.py | m2man/pytorch-lung-segmentation | 1845841b1cc04f179ac9e7552b8b0865443f81f5 | [
"MIT"
] | 11 | 2018-10-23T08:50:54.000Z | 2022-01-11T07:18:02.000Z | setup.py | m2man/pytorch-lung-segmentation | 1845841b1cc04f179ac9e7552b8b0865443f81f5 | [
"MIT"
] | 1 | 2020-03-11T08:31:58.000Z | 2020-03-14T03:03:40.000Z | setup.py | m2man/pytorch-lung-segmentation | 1845841b1cc04f179ac9e7552b8b0865443f81f5 | [
"MIT"
] | 4 | 2019-10-02T12:34:12.000Z | 2021-07-16T14:11:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(name='Pytorch Lung Segmentation',
version="1.0",
description='CXR Lung Segmentation Tools for Pytorch',
packages=find_packages(exclude=[]),
entry_points={
},
include_package_data=True,
... | 23.357143 | 60 | 0.651376 |
from setuptools import setup, find_packages
setup(name='Pytorch Lung Segmentation',
version="1.0",
description='CXR Lung Segmentation Tools for Pytorch',
packages=find_packages(exclude=[]),
entry_points={
},
include_package_data=True,
)
| true | true |
1c344aad8538ab1fa6efeddea18a32c48a3a3f05 | 8,335 | py | Python | Packs/Exabeam/Integrations/Exabeam/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Exabeam/Integrations/Exabeam/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Exabeam/Integrations/Exabeam/test_data/response_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | RESPONSE_PEER_GROUPS = [
"Marketing",
"usa",
"101",
"Program Manager",
"Channel Administrator",
"Chief Marketing Officer",
"",
"Chief Strategy Officer",
"CN=Andrew",
"BitLockerUsersComputers"
]
RESPONSE_USER_LABELS = [
"privileged_user",
"service_account"
]
RESPONSE_WATCH... | 35.317797 | 118 | 0.486623 | RESPONSE_PEER_GROUPS = [
"Marketing",
"usa",
"101",
"Program Manager",
"Channel Administrator",
"Chief Marketing Officer",
"",
"Chief Strategy Officer",
"CN=Andrew",
"BitLockerUsersComputers"
]
RESPONSE_USER_LABELS = [
"privileged_user",
"service_account"
]
RESPONSE_WATCH... | true | true |
1c344b173215b8b1bac7e4170ab0865b4dceac29 | 2,083 | py | Python | graph_solver/solver.py | fleeb24/nlp_capstone | 79eb02fb7174a42ce66ef9121f39ff3d2ac76100 | [
"MIT"
] | null | null | null | graph_solver/solver.py | fleeb24/nlp_capstone | 79eb02fb7174a42ce66ef9121f39ff3d2ac76100 | [
"MIT"
] | null | null | null | graph_solver/solver.py | fleeb24/nlp_capstone | 79eb02fb7174a42ce66ef9121f39ff3d2ac76100 | [
"MIT"
] | null | null | null | """base class that solvers should inherit from"""
from typing import Any
from aristomini.common.models import MultipleChoiceQuestion, MultipleChoiceAnswer, \
SolverAnswer, parse_question
# built in `json` module doesn't serialize namedtuples correctly; `simplejson` does.
import simplejson as json
from flask impo... | 36.54386 | 92 | 0.636102 |
from typing import Any
from aristomini.common.models import MultipleChoiceQuestion, MultipleChoiceAnswer, \
SolverAnswer, parse_question
import simplejson as json
from flask import Flask, request
from flask_cors import CORS
import time
from memory_profiler import profile
class SolverBase:
output = open("me... | true | true |
1c344b70c9edb692f04feab28d891f594e723e8d | 2,407 | py | Python | kumoslab/getServer.py | trand2/Discord-Levels-Bot | ab445ef3291efecf0f0ba36907eab99121d51b89 | [
"Apache-2.0"
] | 38 | 2021-07-10T07:02:58.000Z | 2022-03-30T20:06:58.000Z | kumoslab/getServer.py | trand2/Discord-Levels-Bot | ab445ef3291efecf0f0ba36907eab99121d51b89 | [
"Apache-2.0"
] | 6 | 2021-02-20T18:28:37.000Z | 2021-04-12T05:24:42.000Z | kumoslab/getServer.py | trand2/Discord-Levels-Bot | ab445ef3291efecf0f0ba36907eab99121d51b89 | [
"Apache-2.0"
] | 34 | 2021-07-05T04:31:16.000Z | 2022-03-29T16:28:02.000Z | import discord
from Systems.levelsys import levelling
async def xpPerMessage(guildID=None):
if guildID is None:
print("xpPerMessage requires 'guildID'.")
return
else:
try:
stats = levelling.find_one({"server": guildID})
xp_message = stats['xp_per_mess... | 29.353659 | 61 | 0.561695 | import discord
from Systems.levelsys import levelling
async def xpPerMessage(guildID=None):
if guildID is None:
print("xpPerMessage requires 'guildID'.")
return
else:
try:
stats = levelling.find_one({"server": guildID})
xp_message = stats['xp_per_mess... | true | true |
1c344c547f3ce1b47d143e427a99fd715626effb | 1,261 | py | Python | tests/fixtures.py | schinckel/pipeline-runner | 5642e3ce33ba21d42289bc6e3592e8286b7321d3 | [
"MIT"
] | 6 | 2021-04-23T20:28:24.000Z | 2022-02-12T14:55:27.000Z | tests/fixtures.py | schinckel/pipeline-runner | 5642e3ce33ba21d42289bc6e3592e8286b7321d3 | [
"MIT"
] | 1 | 2022-01-17T14:43:04.000Z | 2022-01-17T14:43:04.000Z | tests/fixtures.py | schinckel/pipeline-runner | 5642e3ce33ba21d42289bc6e3592e8286b7321d3 | [
"MIT"
] | 2 | 2022-01-16T23:32:11.000Z | 2022-02-08T20:39:22.000Z | import os.path
import pytest
from pipeline_runner.models import ProjectMetadata, Repository
@pytest.fixture(autouse=True)
def user_cache_directory(tmp_path, mocker):
cache_dir = os.path.join(tmp_path, "cache")
m = mocker.patch("pipeline_runner.utils.get_cache_directory")
m.return_value = cache_dir
... | 22.927273 | 104 | 0.738303 | import os.path
import pytest
from pipeline_runner.models import ProjectMetadata, Repository
@pytest.fixture(autouse=True)
def user_cache_directory(tmp_path, mocker):
cache_dir = os.path.join(tmp_path, "cache")
m = mocker.patch("pipeline_runner.utils.get_cache_directory")
m.return_value = cache_dir
... | true | true |
1c344cab00d4d50a9b24403c6e30792b5d058549 | 183 | py | Python | portfolio/apps.py | Nearlz/nearlz-portfolio | 7534457184d93e78adde84c439c8564826486fc1 | [
"MIT"
] | null | null | null | portfolio/apps.py | Nearlz/nearlz-portfolio | 7534457184d93e78adde84c439c8564826486fc1 | [
"MIT"
] | null | null | null | portfolio/apps.py | Nearlz/nearlz-portfolio | 7534457184d93e78adde84c439c8564826486fc1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class PortfolioConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'portfolio'
verbose_name = 'Portafolio'
| 20.333333 | 56 | 0.748634 | from django.apps import AppConfig
class PortfolioConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'portfolio'
verbose_name = 'Portafolio'
| true | true |
1c344ec9d1dd5ffd4941ae24892de745f482dabe | 1,540 | py | Python | bci_framework/default_extensions/Car_Raicing_Motor_Imagery_Feedback/main.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | bci_framework/default_extensions/Car_Raicing_Motor_Imagery_Feedback/main.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | bci_framework/default_extensions/Car_Raicing_Motor_Imagery_Feedback/main.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | from bci_framework.extensions.data_analysis import DataAnalysis, loop_consumer, fake_loop_consumer
import logging
import gym
import numpy as np
from predictor import predict
BUFFER = 3 # Segundos de analisis de la señal
SLIDING_DATA = 300 # Cantidad de datos que se actualizaran en cada clasificación
GAS = 0.01
BR... | 26.101695 | 98 | 0.487013 | from bci_framework.extensions.data_analysis import DataAnalysis, loop_consumer, fake_loop_consumer
import logging
import gym
import numpy as np
from predictor import predict
BUFFER = 3
SLIDING_DATA = 300
GAS = 0.01
BREAK_SYSTEM = 0
| true | true |
1c344ee38cb96fde115c113b5cfe7beb7a903d49 | 5,407 | py | Python | cvae.py | samsungsds-rnd/CADD-CVAE | b4a21f65440aaf7cb5c01f163356fb249a6cba30 | [
"MIT"
] | 4 | 2020-07-29T02:44:05.000Z | 2022-01-29T03:33:20.000Z | cvae.py | samsungsds-rnd/CADD-CVAE | b4a21f65440aaf7cb5c01f163356fb249a6cba30 | [
"MIT"
] | null | null | null | cvae.py | samsungsds-rnd/CADD-CVAE | b4a21f65440aaf7cb5c01f163356fb249a6cba30 | [
"MIT"
] | 2 | 2020-07-28T02:29:22.000Z | 2022-03-24T12:22:47.000Z | """
The MIT License
Copyright (c) 2020 Samsung SDS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | 37.034247 | 161 | 0.682819 |
import tensorflow as tf
def gaussian_MLP_conditional_encoder(x, y, n_hidden, n_output, keep_prob):
with tf.variable_scope("gaussian_MLP_encoder"):
dim_y = int(y.get_shape()[1])
input = tf.concat(axis=1, values=[x, y])
w_init = tf.contrib.layers.variance_scaling... | true | true |
1c344f254d4c108da4e293b1f038a9f76e08022d | 7,072 | py | Python | databricks/koalas/usage_logging/__init__.py | charlesdong1991/koalas | 82e2e410817dc1728f97038f193d823f615d0d6a | [
"Apache-2.0"
] | 1 | 2019-09-18T02:36:19.000Z | 2019-09-18T02:36:19.000Z | databricks/koalas/usage_logging/__init__.py | yiming1012/koalas | 326a11c43bb30cb07063e5baf4dab21b4ec90b9d | [
"Apache-2.0"
] | null | null | null | databricks/koalas/usage_logging/__init__.py | yiming1012/koalas | 326a11c43bb30cb07063e5baf4dab21b4ec90b9d | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2019 Databricks, 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 i... | 34.666667 | 99 | 0.670249 |
import functools
import importlib
import inspect
import threading
import time
from types import ModuleType
from typing import Union
import pandas as pd
from databricks.koalas import namespace, sql
from databricks.koalas.frame import DataFrame
from databricks.koalas.datetimes import DatetimeMethods
fro... | true | true |
1c344fb799997b882b34a4550e32ec2812b402b1 | 1,427 | py | Python | Meiduo/apps/carts/utils.py | wanglijing615/python46 | 2c5f84ce79bf352b7a3c57be32f3210ce204c8c0 | [
"MIT"
] | null | null | null | Meiduo/apps/carts/utils.py | wanglijing615/python46 | 2c5f84ce79bf352b7a3c57be32f3210ce204c8c0 | [
"MIT"
] | null | null | null | Meiduo/apps/carts/utils.py | wanglijing615/python46 | 2c5f84ce79bf352b7a3c57be32f3210ce204c8c0 | [
"MIT"
] | null | null | null | # 合并购物车
import base64
import pickle
from django_redis import get_redis_connection
def merge_cart_cookie_to_redis(request, user, response):
'''
如果cookie中的数据redis已存在,则用cookie的数据覆盖redis存在的数据
'''
# 获取cookie数据
cookie_data = request.COOKIES.get('carts')
if cookie_data is not None:
# redis数据... | 33.97619 | 78 | 0.626489 |
import base64
import pickle
from django_redis import get_redis_connection
def merge_cart_cookie_to_redis(request, user, response):
cookie_data = request.COOKIES.get('carts')
if cookie_data is not None:
redis_conn = get_redis_connection('carts')
select... | true | true |
1c3452041494a823a35117badbed2c30dbd08c0a | 58,878 | py | Python | python/mxnet/rnn/rnn_cell.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | null | null | null | python/mxnet/rnn/rnn_cell.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | null | null | null | python/mxnet/rnn/rnn_cell.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | 1 | 2020-01-22T05:15:29.000Z | 2020-01-22T05:15:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.434201 | 108 | 0.585125 |
from __future__ import print_function
import warnings
import functools
from .. import symbol, init, ndarray
from ..base import string_types, numeric_types
def _cells_state_shape(cells):
return sum([c.state_shape for c in cells], [])
def _cells_state_info(cells):
return sum([c.state_inf... | true | true |
1c345256310ad0ce2cab26a85861ef0ba051d2a1 | 60,137 | py | Python | nova/network/neutronv2/api.py | rgerganov/nova | 57e546699eae500bbc0733e3415a65b486cd88c2 | [
"Apache-2.0"
] | 1 | 2021-09-10T15:29:02.000Z | 2021-09-10T15:29:02.000Z | nova/network/neutronv2/api.py | rgerganov/nova | 57e546699eae500bbc0733e3415a65b486cd88c2 | [
"Apache-2.0"
] | null | null | null | nova/network/neutronv2/api.py | rgerganov/nova | 57e546699eae500bbc0733e3415a65b486cd88c2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved
# Copyright (c) 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | 46.36623 | 79 | 0.583767 |
import time
from neutronclient.common import exceptions as neutron_client_exc
from oslo.config import cfg
from nova.compute import flavors
from nova.compute import utils as compute_utils
from nova import conductor
from nova import exception
from nova.network import base_api
from nova.network import m... | true | true |
1c3452a3959b666a053422cb1b7c48ff627fee76 | 552 | py | Python | django_nginx_proxy/django_nginx_proxy/images/views.py | ghjan/blog-projects | aa6925724e457bec276d98cf7b55b5cdaf2ab5f4 | [
"MIT"
] | 66 | 2017-11-18T06:41:39.000Z | 2021-09-02T15:47:08.000Z | django_nginx_proxy/django_nginx_proxy/images/views.py | ghjan/blog-projects | aa6925724e457bec276d98cf7b55b5cdaf2ab5f4 | [
"MIT"
] | 2 | 2018-05-28T14:06:05.000Z | 2020-03-21T14:05:07.000Z | django_nginx_proxy/django_nginx_proxy/images/views.py | ghjan/blog-projects | aa6925724e457bec276d98cf7b55b5cdaf2ab5f4 | [
"MIT"
] | 35 | 2017-11-05T23:48:15.000Z | 2021-09-15T12:15:39.000Z | from django.http import HttpResponse
from rest_framework import viewsets
from .models import Image
from .serializers import ImageSerializer
class ImagesViewSet(viewsets.ModelViewSet):
queryset = Image.objects.all()
serializer_class = ImageSerializer
def download_image_view(request, image_id):
image = I... | 29.052632 | 95 | 0.766304 | from django.http import HttpResponse
from rest_framework import viewsets
from .models import Image
from .serializers import ImageSerializer
class ImagesViewSet(viewsets.ModelViewSet):
queryset = Image.objects.all()
serializer_class = ImageSerializer
def download_image_view(request, image_id):
image = I... | true | true |
1c345372755538992940b68fec8448c5fa57ad4b | 5,664 | py | Python | src/Python/Rendering/Rotations.py | cvandijck/VTKExamples | b6bb89414522afc1467be8a1f0089a37d0c16883 | [
"Apache-2.0"
] | 309 | 2017-05-21T09:07:19.000Z | 2022-03-15T09:18:55.000Z | src/Python/Rendering/Rotations.py | yijianmingliu/VTKExamples | dc8aac47c4384f9a2de9facbdd1ab3249f62ec99 | [
"Apache-2.0"
] | 379 | 2017-05-21T09:06:43.000Z | 2021-03-29T20:30:50.000Z | src/Python/Rendering/Rotations.py | yijianmingliu/VTKExamples | dc8aac47c4384f9a2de9facbdd1ab3249f62ec99 | [
"Apache-2.0"
] | 170 | 2017-05-17T14:47:41.000Z | 2022-03-31T13:16:26.000Z | #!/usr/local/bin/python
import vtk
def main():
"""
To match the illustrations in VTKTextbook.pdf, use BkgColor as the background and
Wheat as the cow colour.
Also comment out the lines:
modelActor->GetProperty()->SetSpecular(.6);
modelActor->GetProperty()->SetSpecula... | 27.100478 | 89 | 0.640007 |
import vtk
def main():
file_name, figure, book_color = get_program_parameters()
rotate(file_name, figure, book_color)
def rotate(file_name, figure, book_color):
colors = vtk.vtkNamedColors()
colors.SetColor("BkgColor", [26, 51, 102, 255])
ren1 = vtk.vtkRenderer()
renWi... | true | true |
1c345500fafb45a8bdc24f42c1f4a6ff976133f4 | 125 | py | Python | Python/interview/qumulo/RangeQuery.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | 2 | 2015-12-02T06:44:01.000Z | 2016-05-04T21:40:54.000Z | Python/interview/qumulo/RangeQuery.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | Python/interview/qumulo/RangeQuery.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | '''
Created on 2016年2月3日
给一个stream的integer,然后要提供query返回当前所有的range,举例: 读了8, 6, 4, 7 这个时候query的结果是 4, 6-8
@author: Darren
'''
| 20.833333 | 79 | 0.744 | true | true | |
1c3455318e97efa1db73dd592fe94267ca56a011 | 341 | py | Python | GlobalDataset/scripts/runChi_ca.py | gehilley/GlobalSteepness | 62a1a5b66adb230d5bbbc004aa5d2c5b618a2fdd | [
"MIT"
] | 3 | 2019-09-19T00:04:27.000Z | 2020-02-17T16:17:55.000Z | GlobalDataset/scripts/runChi_ca.py | gehilley/GlobalSteepness | 62a1a5b66adb230d5bbbc004aa5d2c5b618a2fdd | [
"MIT"
] | null | null | null | GlobalDataset/scripts/runChi_ca.py | gehilley/GlobalSteepness | 62a1a5b66adb230d5bbbc004aa5d2c5b618a2fdd | [
"MIT"
] | 1 | 2020-12-17T07:35:23.000Z | 2020-12-17T07:35:23.000Z | from denudationRateAnalysis import create_chi_grid_for_geographic_prefix as create_chi
prefix = 'ca'
thetas = [0.4]
Ao = 1000000
basin_lengths = [200000, 400000]
create_chi(prefix, thetas, Ao, basin_lengths)
thetas = [0.5, 0.6]
Ao = 1000000
basin_lengths = [50000, 100000, 200000, 400000]
create_chi(prefix, thetas,... | 21.3125 | 86 | 0.762463 | from denudationRateAnalysis import create_chi_grid_for_geographic_prefix as create_chi
prefix = 'ca'
thetas = [0.4]
Ao = 1000000
basin_lengths = [200000, 400000]
create_chi(prefix, thetas, Ao, basin_lengths)
thetas = [0.5, 0.6]
Ao = 1000000
basin_lengths = [50000, 100000, 200000, 400000]
create_chi(prefix, thetas,... | true | true |
1c3455572835a396c5b9ce8dbc523e4c7cdab412 | 25,400 | py | Python | include/HydrusPaths.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | include/HydrusPaths.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | include/HydrusPaths.py | sorashi/hydrus | 0544a75d2117904b42e935d264ae35ded5cbf36a | [
"WTFPL"
] | null | null | null | import gc
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusExceptions
from . import HydrusGlobals as HG
from . import HydrusThreading
import os
import psutil
import re
import send2trash
import shlex
import shutil
import stat
import subprocess
import sys
import tempfile
import threading
i... | 27.021277 | 263 | 0.474685 | import gc
from . import HydrusConstants as HC
from . import HydrusData
from . import HydrusExceptions
from . import HydrusGlobals as HG
from . import HydrusThreading
import os
import psutil
import re
import send2trash
import shlex
import shutil
import stat
import subprocess
import sys
import tempfile
import threading
i... | true | true |
1c3455ca9c971c916f4933e0da598e6c42614779 | 839 | py | Python | redis/komand_redis/connection/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | redis/komand_redis/connection/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | redis/komand_redis/connection/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
DB = "db"
HOST = "host"
PORT = "port"
class ConnectionSchema(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"db": {
"type": "integer",
"title"... | 17.122449 | 57 | 0.481526 |
import komand
import json
class Input:
DB = "db"
HOST = "host"
PORT = "port"
class ConnectionSchema(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"db": {
"type": "integer",
"title": "Db",
"description": "Db to use... | true | true |
1c3457250f101412380d1086885f23899c6583c6 | 3,076 | py | Python | tests/test_meta_info_in_datapipe_events.py | epoch8/datapipe | 2358e13f6699b44950dc87fda6136f34fa719094 | [
"BSD-3-Clause"
] | 2 | 2021-12-20T10:17:25.000Z | 2022-02-16T09:00:51.000Z | tests/test_meta_info_in_datapipe_events.py | epoch8/datapipe | 2358e13f6699b44950dc87fda6136f34fa719094 | [
"BSD-3-Clause"
] | 25 | 2021-12-18T21:19:19.000Z | 2022-03-30T18:53:22.000Z | tests/test_meta_info_in_datapipe_events.py | epoch8/datapipe | 2358e13f6699b44950dc87fda6136f34fa719094 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
from sqlalchemy.sql.expression import select
from datapipe.run_config import RunConfig
from datapipe.store.database import TableStoreDB
from datapipe.datatable import DataStore
from datapipe.compute import Catalog, Pipeline,\
Table
from datapipe.core_steps import BatchTransform, BatchGenerate
f... | 25.00813 | 123 | 0.525033 | import pandas as pd
from sqlalchemy.sql.expression import select
from datapipe.run_config import RunConfig
from datapipe.store.database import TableStoreDB
from datapipe.datatable import DataStore
from datapipe.compute import Catalog, Pipeline,\
Table
from datapipe.core_steps import BatchTransform, BatchGenerate
f... | true | true |
1c3457b3679d6e51416fa4b3b071fcd14187e1ea | 50 | py | Python | final_project/machinetranslation/__init__.py | aneeshmraj/xzceb-flask_eng_fr | 0c39955f8d478b9a39c4699ee5a34a0358567fe2 | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/__init__.py | aneeshmraj/xzceb-flask_eng_fr | 0c39955f8d478b9a39c4699ee5a34a0358567fe2 | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/__init__.py | aneeshmraj/xzceb-flask_eng_fr | 0c39955f8d478b9a39c4699ee5a34a0358567fe2 | [
"Apache-2.0"
] | null | null | null | from . import translator
from .translator import * | 25 | 25 | 0.8 | from . import translator
from .translator import * | true | true |
1c3457fc93584b1aaf78aaf5fba0b0196d489046 | 5,561 | py | Python | ckanext/stats/tests/test_stats_lib.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | 2 | 2021-02-19T20:06:52.000Z | 2021-04-15T20:42:11.000Z | ckanext/stats/tests/test_stats_lib.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | null | null | null | ckanext/stats/tests/test_stats_lib.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | 4 | 2016-12-17T22:26:06.000Z | 2017-01-20T21:51:24.000Z | import datetime
from nose.tools import assert_equal
from ckan.lib.create_test_data import CreateTestData
from ckan import model
from ckanext.stats.stats import Stats, RevisionStats
from ckanext.stats.tests import StatsFixture
class TestStatsPlugin(StatsFixture):
@classmethod
def setup_class(cls):
sup... | 41.192593 | 112 | 0.583168 | import datetime
from nose.tools import assert_equal
from ckan.lib.create_test_data import CreateTestData
from ckan import model
from ckanext.stats.stats import Stats, RevisionStats
from ckanext.stats.tests import StatsFixture
class TestStatsPlugin(StatsFixture):
@classmethod
def setup_class(cls):
sup... | true | true |
1c345875ce04261a77333e4c94e02945a5609af8 | 856 | py | Python | test/test_ndb.py | jinglundong/GuessGame | d6953d279d476c1281d15369ee18135c241441a5 | [
"MIT"
] | null | null | null | test/test_ndb.py | jinglundong/GuessGame | d6953d279d476c1281d15369ee18135c241441a5 | [
"MIT"
] | null | null | null | test/test_ndb.py | jinglundong/GuessGame | d6953d279d476c1281d15369ee18135c241441a5 | [
"MIT"
] | null | null | null | import unittest
import cgi
import os
from google.appengine.ext import ndb
from google.appengine.api import memcache
from google.appengine.ext import testbed
class Account(ndb.Model):
username = ndb.StringProperty()
userid = ndb.IntegerProperty()
email = ndb.StringProperty()
class TestAccount(unittest.Test... | 27.612903 | 68 | 0.682243 | import unittest
import cgi
import os
from google.appengine.ext import ndb
from google.appengine.api import memcache
from google.appengine.ext import testbed
class Account(ndb.Model):
username = ndb.StringProperty()
userid = ndb.IntegerProperty()
email = ndb.StringProperty()
class TestAccount(unittest.Test... | true | true |
1c345971a15ac04b067a535bad2f3fc25ddfe4ab | 4,667 | py | Python | server/auvsi_suas/views/map.py | UnmannedAerialSystems/interop | cb36506f7fb795ef2432a5e5a0b7b29917eddbdc | [
"Apache-2.0"
] | 175 | 2015-09-15T15:37:06.000Z | 2022-02-14T23:21:48.000Z | server/auvsi_suas/views/map.py | UnmannedAerialSystems/interop | cb36506f7fb795ef2432a5e5a0b7b29917eddbdc | [
"Apache-2.0"
] | 376 | 2015-09-16T19:34:15.000Z | 2022-02-19T12:55:55.000Z | server/auvsi_suas/views/map.py | UnmannedAerialSystems/interop | cb36506f7fb795ef2432a5e5a0b7b29917eddbdc | [
"Apache-2.0"
] | 109 | 2015-09-16T17:05:14.000Z | 2022-01-26T12:49:38.000Z | """Map view."""
from PIL import Image
import io
import json
import logging
import os
import os.path
from auvsi_suas.models.map import Map
from auvsi_suas.models.mission_config import MissionConfig
from auvsi_suas.proto import interop_admin_api_pb2
from auvsi_suas.views.decorators import require_login
from auvsi_suas.v... | 31.748299 | 79 | 0.635526 |
from PIL import Image
import io
import json
import logging
import os
import os.path
from auvsi_suas.models.map import Map
from auvsi_suas.models.mission_config import MissionConfig
from auvsi_suas.proto import interop_admin_api_pb2
from auvsi_suas.views.decorators import require_login
from auvsi_suas.views.decorators ... | true | true |
1c3459e9b4d5a65bbdbfb0b4c76dbef94560f5e8 | 2,409 | py | Python | studies/tests/tests_fonctionnal/test_selenium.py | tbuglioni/unlimited-studies | 8d5e75d1c3767b7e108e6cf8737462f891410af0 | [
"MIT"
] | null | null | null | studies/tests/tests_fonctionnal/test_selenium.py | tbuglioni/unlimited-studies | 8d5e75d1c3767b7e108e6cf8737462f891410af0 | [
"MIT"
] | 25 | 2021-07-07T15:05:15.000Z | 2021-11-22T13:46:37.000Z | studies/tests/tests_fonctionnal/test_selenium.py | tbuglioni/unlimited-studies | 8d5e75d1c3767b7e108e6cf8737462f891410af0 | [
"MIT"
] | null | null | null | import time
from django.contrib.auth import get_user_model
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from studies.tests.speed_set_up import SpeedSetUP
from unlimited_studies.settings import BASE_DIR
chrome_options = webdriver.ChromeOptions()
chrome_options.... | 35.426471 | 79 | 0.686177 | import time
from django.contrib.auth import get_user_model
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from studies.tests.speed_set_up import SpeedSetUP
from unlimited_studies.settings import BASE_DIR
chrome_options = webdriver.ChromeOptions()
chrome_options.... | true | true |
1c345a091eae0ec0dabc1e2a8d867aff74d232ac | 998 | py | Python | ex2_4.py | leo-gal/pyplus_exercise | 223d3c16fe485a0ee99c3ab7d161a758975a9d7b | [
"Apache-2.0"
] | null | null | null | ex2_4.py | leo-gal/pyplus_exercise | 223d3c16fe485a0ee99c3ab7d161a758975a9d7b | [
"Apache-2.0"
] | null | null | null | ex2_4.py | leo-gal/pyplus_exercise | 223d3c16fe485a0ee99c3ab7d161a758975a9d7b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from netmiko import ConnectHandler
from getpass import getpass
from pprint import pprint
from datetime import datetime
device1 = {
"host": "cisco3.lasthop.io",
"username": "pyclass",
"password": getpass(),
"device_type": "cisco_ios",
# "session_log": sessio... | 23.209302 | 67 | 0.675351 |
from netmiko import ConnectHandler
from getpass import getpass
from pprint import pprint
from datetime import datetime
device1 = {
"host": "cisco3.lasthop.io",
"username": "pyclass",
"password": getpass(),
"device_type": "cisco_ios",
}
cfg = [
"ip name-server 1.1.1.1",
"no i... | true | true |
1c345b10dc647f9eb8d6b8cf83725d3b7601e99a | 21,926 | py | Python | sunpy/image/coalignment.py | jgieseler/sunpy | 9eb01ce9eea43512cc928b17c6d79ac06dce0ece | [
"BSD-2-Clause"
] | null | null | null | sunpy/image/coalignment.py | jgieseler/sunpy | 9eb01ce9eea43512cc928b17c6d79ac06dce0ece | [
"BSD-2-Clause"
] | null | null | null | sunpy/image/coalignment.py | jgieseler/sunpy | 9eb01ce9eea43512cc928b17c6d79ac06dce0ece | [
"BSD-2-Clause"
] | null | null | null | """
This module provides routines for the co-alignment of images and
`~sunpy.map.mapsequence.MapSequence`.
Currently this module provides image co-alignment by template matching.
Which is partially inspired by the SSWIDL routine
`tr_get_disp.pro <http://www.heliodocs.com/php/xdoc_print.php?file=$SSW/trace/idl/util/tr_... | 39.223614 | 107 | 0.654793 | from copy import deepcopy
import numpy as np
from scipy.ndimage import shift
from skimage.feature import match_template
import astropy.units as u
import sunpy.map
from sunpy.map.mapbase import GenericMap
from sunpy.util.exceptions import warn_user
__all__ = ['calculate_shift', 'clip_edges', 'calculate_clipping',
... | true | true |
1c345be2960605a8a694db8b16371dd381f0a450 | 294 | py | Python | Books/GodOfPython/P13_Exception/Error7.py | Tim232/Python-Things | 05f0f373a4cf298e70d9668c88a6e3a9d1cd8146 | [
"MIT"
] | 2 | 2020-12-05T07:42:55.000Z | 2021-01-06T23:23:18.000Z | Books/GodOfPython/P13_Exception/Error7.py | Tim232/Python-Things | 05f0f373a4cf298e70d9668c88a6e3a9d1cd8146 | [
"MIT"
] | null | null | null | Books/GodOfPython/P13_Exception/Error7.py | Tim232/Python-Things | 05f0f373a4cf298e70d9668c88a6e3a9d1cd8146 | [
"MIT"
] | null | null | null | dic = {'apple':2, 'banana':10, 'fineapple':5}
while True:
data = input('>')
try:
dic[data]
except KeyError:
print('There is no data.')
except KeyboardInterrupt:
break
else:
print('{} : {}개'.format(data, dic[data]))
print('continue...') | 19.6 | 49 | 0.527211 | dic = {'apple':2, 'banana':10, 'fineapple':5}
while True:
data = input('>')
try:
dic[data]
except KeyError:
print('There is no data.')
except KeyboardInterrupt:
break
else:
print('{} : {}개'.format(data, dic[data]))
print('continue...') | true | true |
1c345ccde033993b4622a4caa582ed4f70588da8 | 2,065 | py | Python | pyusermanager/Token/token_activation_class.py | Aurvandill137/pyusermanager | 56bb16b3ed510eee70ff33ccafdc0a9b0fc673b0 | [
"MIT"
] | 3 | 2022-02-13T14:10:35.000Z | 2022-02-14T00:20:02.000Z | pyusermanager/Token/token_activation_class.py | Aurvandill137/pyusermanager | 56bb16b3ed510eee70ff33ccafdc0a9b0fc673b0 | [
"MIT"
] | null | null | null | pyusermanager/Token/token_activation_class.py | Aurvandill137/pyusermanager | 56bb16b3ed510eee70ff33ccafdc0a9b0fc673b0 | [
"MIT"
] | 1 | 2022-02-13T14:10:03.000Z | 2022-02-13T14:10:03.000Z | from pony.orm import db_session
from .. import custom_exceptions as PyUserExceptions
from .token_base_class import Token
import datetime
###########################
#
# Activation Token
#
###########################
class Activation(Token):
"""For Activation Tokens"""
def __init__(self, config, token=None, us... | 32.777778 | 114 | 0.565617 | from pony.orm import db_session
from .. import custom_exceptions as PyUserExceptions
from .token_base_class import Token
import datetime
return True
else:
return False
except (ValueError, AttributeError):
return False
def ... | true | true |
1c345ce488eb0af0c8bfd2eb609b9a26bd994d93 | 7,157 | py | Python | syph_visualizer.py | michellejlin/tprk | 04758e40c7dd9060d4d613c52b650e250297cb7a | [
"MIT"
] | 1 | 2020-08-26T22:27:17.000Z | 2020-08-26T22:27:17.000Z | syph_visualizer.py | michellejlin/tprk | 04758e40c7dd9060d4d613c52b650e250297cb7a | [
"MIT"
] | null | null | null | syph_visualizer.py | michellejlin/tprk | 04758e40c7dd9060d4d613c52b650e250297cb7a | [
"MIT"
] | 3 | 2019-11-01T00:46:06.000Z | 2020-08-26T22:27:23.000Z | import numpy as np
import pandas as pd
import argparse
import sys
from bokeh.palettes import brewer
from bokeh import events
from bokeh.io import export_png, save, export_svgs
from bokeh.resources import CDN
from bokeh.embed import components, file_html, autoload_static
from bokeh.plotting import figure, show, output_f... | 42.349112 | 174 | 0.691072 | import numpy as np
import pandas as pd
import argparse
import sys
from bokeh.palettes import brewer
from bokeh import events
from bokeh.io import export_png, save, export_svgs
from bokeh.resources import CDN
from bokeh.embed import components, file_html, autoload_static
from bokeh.plotting import figure, show, output_f... | true | true |
1c345d218b09b979ba38f61cf27f3d2c15376caf | 55 | py | Python | src/whylogs/src/whylabs/logs/_version.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | src/whylogs/src/whylabs/logs/_version.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | src/whylogs/src/whylabs/logs/_version.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | """WhyLabs version number."""
__version__ = "0.0.2b3"
| 13.75 | 29 | 0.654545 |
__version__ = "0.0.2b3"
| true | true |
1c345db80ab641d6f598e92745e655a04bceda85 | 3,339 | py | Python | critiquebrainz/frontend/external/musicbrainz_db/event.py | shagun6/critiquebrainz | b7ae41fb09ff4dd4e34847b294fbee4ccc76bad5 | [
"Apache-2.0"
] | null | null | null | critiquebrainz/frontend/external/musicbrainz_db/event.py | shagun6/critiquebrainz | b7ae41fb09ff4dd4e34847b294fbee4ccc76bad5 | [
"Apache-2.0"
] | null | null | null | critiquebrainz/frontend/external/musicbrainz_db/event.py | shagun6/critiquebrainz | b7ae41fb09ff4dd4e34847b294fbee4ccc76bad5 | [
"Apache-2.0"
] | 1 | 2020-02-06T19:26:10.000Z | 2020-02-06T19:26:10.000Z | from collections import defaultdict
from mbdata import models
from critiquebrainz.frontend.external.musicbrainz_db import mb_session, DEFAULT_CACHE_EXPIRATION
from critiquebrainz.frontend.external.musicbrainz_db.utils import get_entities_by_gids
from critiquebrainz.frontend.external.musicbrainz_db.includes import check... | 34.071429 | 102 | 0.614256 | from collections import defaultdict
from mbdata import models
from critiquebrainz.frontend.external.musicbrainz_db import mb_session, DEFAULT_CACHE_EXPIRATION
from critiquebrainz.frontend.external.musicbrainz_db.utils import get_entities_by_gids
from critiquebrainz.frontend.external.musicbrainz_db.includes import check... | true | true |
1c345f209c6a268c29238a3acd4162bb45be0880 | 1,141 | py | Python | akamaiopen/cloudlets/matches/GeoMatches.py | lukaszczerpak/vpf-cli | fb572152fcce934cb4a1718a788b0b6402e83e83 | [
"MIT"
] | 2 | 2021-02-04T20:38:25.000Z | 2021-09-24T09:18:10.000Z | akamaiopen/cloudlets/matches/GeoMatches.py | lukaszczerpak/vpf-cli | fb572152fcce934cb4a1718a788b0b6402e83e83 | [
"MIT"
] | null | null | null | akamaiopen/cloudlets/matches/GeoMatches.py | lukaszczerpak/vpf-cli | fb572152fcce934cb4a1718a788b0b6402e83e83 | [
"MIT"
] | null | null | null | import abc
from enum import Enum
from akamaiopen.cloudlets.matches.Match import Match, MatchOperator
class CheckIPsType(Enum):
CONNECTING = 'CONNECTING_IP'
XFF = 'XFF_HEADERS'
BOTH = 'CONNECTING_IP XFF_HEADERS'
class GeoMatch(Match, metaclass=abc.ABCMeta):
def __init__(self, match_value=None, match... | 26.534884 | 159 | 0.684487 | import abc
from enum import Enum
from akamaiopen.cloudlets.matches.Match import Match, MatchOperator
class CheckIPsType(Enum):
CONNECTING = 'CONNECTING_IP'
XFF = 'XFF_HEADERS'
BOTH = 'CONNECTING_IP XFF_HEADERS'
class GeoMatch(Match, metaclass=abc.ABCMeta):
def __init__(self, match_value=None, match... | true | true |
1c345f360494b8f42d09ea0515866ef611bb87e4 | 3,860 | py | Python | data_layers/toi_reg_data_layer.py | ilikepistachio/TCNN_STCNN | 925939adfb009bee55add0a7ae9cf5db29c83871 | [
"MIT"
] | 33 | 2018-06-19T08:50:09.000Z | 2021-10-03T07:18:34.000Z | data_layers/toi_reg_data_layer.py | ilikepistachio/TCNN_STCNN | 925939adfb009bee55add0a7ae9cf5db29c83871 | [
"MIT"
] | 7 | 2018-07-20T06:31:39.000Z | 2020-06-30T03:39:52.000Z | data_layers/toi_reg_data_layer.py | ilikepistachio/TCNN_STCNN | 925939adfb009bee55add0a7ae9cf5db29c83871 | [
"MIT"
] | 14 | 2018-07-10T06:32:34.000Z | 2022-03-17T04:01:15.000Z | '''
The Caffe data layer for training label classifier.
This layer will parse pixel values and actionness labels to the network.
'''
import sys
sys.path.insert(0, '/home/rhou/caffe/python')
import caffe
from dataset.ucf_sports import UcfSports
import numpy as np
from utils.cython_bbox import bbox_overlaps
from utils.bb... | 35.740741 | 79 | 0.637824 | import sys
sys.path.insert(0, '/home/rhou/caffe/python')
import caffe
from dataset.ucf_sports import UcfSports
import numpy as np
from utils.cython_bbox import bbox_overlaps
from utils.bbox_transform import bbox_transform
class RegDataLayer(caffe.Layer):
def setup(self, bottom, top):
self._batch_size = 1
sel... | true | true |
1c345f40e98a5bcddc9dc85d980806bc458085e0 | 5,428 | py | Python | setup.py | hellvix/django-ses | 90ec1147ed1ef7bbf5e29f4b20775768d1b270ec | [
"MIT"
] | 522 | 2015-05-06T00:43:47.000Z | 2022-03-31T21:22:02.000Z | setup.py | hellvix/django-ses | 90ec1147ed1ef7bbf5e29f4b20775768d1b270ec | [
"MIT"
] | 143 | 2015-04-24T14:02:18.000Z | 2022-03-31T23:58:26.000Z | setup.py | hellvix/django-ses | 90ec1147ed1ef7bbf5e29f4b20775768d1b270ec | [
"MIT"
] | 160 | 2015-04-30T20:37:21.000Z | 2022-03-20T03:11:44.000Z | import ast
import os
import re
import sys
from fnmatch import fnmatchcase
from distutils.util import convert_path
from setuptools import setup, find_packages
def read(*path):
return open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
*path)).read()
# Provided as an attri... | 34.138365 | 98 | 0.577561 | import ast
import os
import re
import sys
from fnmatch import fnmatchcase
from distutils.util import convert_path
from setuptools import setup, find_packages
def read(*path):
return open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
*path)).read()
standard_exclude = [... | true | true |
1c34606f23133870724c0dd1f7e3327f5acd55d9 | 956 | py | Python | NFL_Projects/app.py | lpdabest1/NFL_Scraper_App | a396a5071257e43bca6f681f393f249a05f4bb1f | [
"MIT"
] | null | null | null | NFL_Projects/app.py | lpdabest1/NFL_Scraper_App | a396a5071257e43bca6f681f393f249a05f4bb1f | [
"MIT"
] | 1 | 2022-02-10T03:42:23.000Z | 2022-02-10T03:42:23.000Z | NFL_Projects/app.py | lpdabest1/NFL_Scraper_App | a396a5071257e43bca6f681f393f249a05f4bb1f | [
"MIT"
] | 1 | 2021-09-27T20:37:27.000Z | 2021-09-27T20:37:27.000Z | import Passing_Stats
import Rushing_Stats
import Receiving_Stats
import Defensive_Player_Stats
import Kicking_Stats
import Kick_Returning_Stats
import Scoring_Stats
import Fantasy_Stats
import streamlit as st
import streamlit.components.v1 as components
st.set_page_config(
page_title="NFL Web Scraper App",
lay... | 23.9 | 104 | 0.766736 | import Passing_Stats
import Rushing_Stats
import Receiving_Stats
import Defensive_Player_Stats
import Kicking_Stats
import Kick_Returning_Stats
import Scoring_Stats
import Fantasy_Stats
import streamlit as st
import streamlit.components.v1 as components
st.set_page_config(
page_title="NFL Web Scraper App",
lay... | true | true |
1c3462783ef0c7362128a92c7bda56697b39a2e8 | 722 | py | Python | src/genie/libs/parser/bigip/get_ltm_data_groupinternal.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/bigip/get_ltm_data_groupinternal.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/bigip/get_ltm_data_groupinternal.py | nujo/genieparser | 083b01efc46afc32abe1a1858729578beab50cd3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | # Global Imports
import json
from collections import defaultdict
# Metaparser
from genie.metaparser import MetaParser
# =============================================
# Collection for '/mgmt/tm/ltm/data-group/internal' resources
# =============================================
class LtmDatagroupInternalSchema(MetaPar... | 21.235294 | 61 | 0.608033 |
import json
from collections import defaultdict
from genie.metaparser import MetaParser
class LtmDatagroupInternalSchema(MetaParser):
schema = {}
class LtmDatagroupInternal(LtmDatagroupInternalSchema):
cli_command = "/mgmt/tm/ltm/data-group/internal"
def rest(self):
response = self.de... | true | true |
1c3463602eca234c2e4b004621182211828f78ee | 948,897 | py | Python | test/test_nn.py | VincentLeeMax/pytorch | 5e6f29661254e5ebc97fac3d829e5d455cda5864 | [
"Intel"
] | 1 | 2022-02-05T18:15:29.000Z | 2022-02-05T18:15:29.000Z | test/test_nn.py | VincentLeeMax/pytorch | 5e6f29661254e5ebc97fac3d829e5d455cda5864 | [
"Intel"
] | 1 | 2022-02-03T12:43:23.000Z | 2022-02-03T12:47:53.000Z | test/test_nn.py | VincentLeeMax/pytorch | 5e6f29661254e5ebc97fac3d829e5d455cda5864 | [
"Intel"
] | null | null | null | # Owner(s): ["module: nn"]
import math
import random
import string
import unittest
import io
import unittest.mock as mock
import itertools
import warnings
import pickle
from copy import deepcopy
from itertools import repeat, product
from functools import reduce, partial
from operator import mul
from collections import... | 46.473553 | 132 | 0.584683 |
import math
import random
import string
import unittest
import io
import unittest.mock as mock
import itertools
import warnings
import pickle
from copy import deepcopy
from itertools import repeat, product
from functools import reduce, partial
from operator import mul
from collections import OrderedDict
import torch... | true | true |
1c346385bc302ce04a1fb5d8618983f744e70098 | 23,858 | py | Python | huggingface-gpt2/ort_addon/ort_supplement/src/transformers/trainer_ort.py | kshama-msft/onnxruntime-training-examples | 0192a776e2fc62f1eeda3e3f1200cf40448302c1 | [
"MIT"
] | null | null | null | huggingface-gpt2/ort_addon/ort_supplement/src/transformers/trainer_ort.py | kshama-msft/onnxruntime-training-examples | 0192a776e2fc62f1eeda3e3f1200cf40448302c1 | [
"MIT"
] | null | null | null | huggingface-gpt2/ort_addon/ort_supplement/src/transformers/trainer_ort.py | kshama-msft/onnxruntime-training-examples | 0192a776e2fc62f1eeda3e3f1200cf40448302c1 | [
"MIT"
] | null | null | null | import json
import time
import logging
import os
import random
import re
import shutil
from contextlib import contextmanager
from pathlib import Path
from typing import Callable, Dict, List, NamedTuple, Optional, Tuple
import numpy as np
import torch
from torch import nn
from torch.utils.data.dataloader import DataLoa... | 42.679785 | 158 | 0.619583 | import json
import time
import logging
import os
import random
import re
import shutil
from contextlib import contextmanager
from pathlib import Path
from typing import Callable, Dict, List, NamedTuple, Optional, Tuple
import numpy as np
import torch
from torch import nn
from torch.utils.data.dataloader import DataLoa... | true | true |
1c346472665faf8d7a4d71f45fe1217ce194b535 | 3,029 | py | Python | pibooth/scripts/regenerate.py | IAmCorbin/pibooth | c73f379ca86ce1ce73a1e4816e41e74349ae5a30 | [
"MIT"
] | null | null | null | pibooth/scripts/regenerate.py | IAmCorbin/pibooth | c73f379ca86ce1ce73a1e4816e41e74349ae5a30 | [
"MIT"
] | 1 | 2019-12-13T18:29:47.000Z | 2019-12-13T18:29:47.000Z | pibooth/scripts/regenerate.py | IAmCorbin/pibooth | c73f379ca86ce1ce73a1e4816e41e74349ae5a30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Pibooth picture regeneration module.
"""
import os
from os import path as osp
from PIL import Image
from pibooth.utils import LOGGER, configure_logging
from pibooth.config import PiConfigParser
from pibooth.pictures import get_picture_maker
def get_captures(images_folder):
"""Get a ... | 34.420455 | 108 | 0.658963 |
import os
from os import path as osp
from PIL import Image
from pibooth.utils import LOGGER, configure_logging
from pibooth.config import PiConfigParser
from pibooth.pictures import get_picture_maker
def get_captures(images_folder):
captures_paths = os.listdir(images_folder)
captures = []
for capture... | true | true |
1c3467031d6a858936ba06df5f76eb7581feb8c5 | 1,685 | py | Python | sdk/python/lib/pulumi/invoke.py | Dominik-K/pulumi | 3621c01f4becf75e24bf937bbda69ff8aaf6b5f7 | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/pulumi/invoke.py | Dominik-K/pulumi | 3621c01f4becf75e24bf937bbda69ff8aaf6b5f7 | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/pulumi/invoke.py | Dominik-K/pulumi | 3621c01f4becf75e24bf937bbda69ff8aaf6b5f7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2018, Pulumi Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 43.205128 | 118 | 0.705638 |
from typing import Optional
class InvokeOptions:
parent: Optional['Resource']
provider: Optional['ProviderResource']
def __init__(self, parent: Optional['Resource'] = None, provider: Optional['ProviderResource'] = None) -> None:
self.parent = parent
self.provider = provider
| true | true |
1c34679bf1e7909cfa7290e79c3a1b6a773fcca3 | 1,227 | py | Python | MultiAnalysis/lexical-analysis.py | Aczy156/compiler-theory-algorithm | fb8ab65a1315fb206bfa788038dbc61a96957ec9 | [
"MIT"
] | 6 | 2020-12-15T18:37:58.000Z | 2021-09-27T13:47:39.000Z | MultiAnalysis/lexical-analysis.py | Aczy156/Compiling-Principle-Work | fb8ab65a1315fb206bfa788038dbc61a96957ec9 | [
"MIT"
] | null | null | null | MultiAnalysis/lexical-analysis.py | Aczy156/Compiling-Principle-Work | fb8ab65a1315fb206bfa788038dbc61a96957ec9 | [
"MIT"
] | 3 | 2020-06-22T05:33:38.000Z | 2020-07-20T13:54:05.000Z | import re
# valid token
token_dict = {
'int': 1, 'double': 1, 'string': 1, 'if': 1, 'else': 1, 'return': 1, 'main': 1, 'void': 1, 'while': 1, 'for': 1,
'break': 1,
'+': 4, '-': 4, '*': 4, '/': 4, '<': 4, '>': 4, '=': 4, '==': 4,
',': 5, ';': 5, '(': 5, ')': 5, '{': 5,
}
# invalid token
invalid_token =... | 24.54 | 116 | 0.431948 | import re
token_dict = {
'int': 1, 'double': 1, 'string': 1, 'if': 1, 'else': 1, 'return': 1, 'main': 1, 'void': 1, 'while': 1, 'for': 1,
'break': 1,
'+': 4, '-': 4, '*': 4, '/': 4, '<': 4, '>': 4, '=': 4, '==': 4,
',': 5, ';': 5, '(': 5, ')': 5, '{': 5,
}
invalid_token = [',', ';', '!', '(', ')']
... | true | true |
1c3467f60c4ad981307c06f1b929e3d0ecb18b38 | 37,402 | py | Python | pkgs/conf-pkg/src/genie/libs/conf/rip/nxos/tests/test_rip.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/conf-pkg/src/genie/libs/conf/rip/nxos/tests/test_rip.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/conf-pkg/src/genie/libs/conf/rip/nxos/tests/test_rip.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | #!/usr/bin/env python
# Import unittest module
import unittest
from unittest.mock import Mock
from pyats.datastructures import WeakList
# And import what's needed
from genie.tests.conf import TestCase
from genie.conf import Genie
from genie.conf.base import Testbed, Device, Link, Interface
from genie.conf.base.attri... | 40.044968 | 115 | 0.594273 |
import unittest
from unittest.mock import Mock
from pyats.datastructures import WeakList
from genie.tests.conf import TestCase
from genie.conf import Genie
from genie.conf.base import Testbed, Device, Link, Interface
from genie.conf.base.attributes import SubAttributesDict
from genie.libs.conf.rip import Rip
fro... | true | true |
1c34696f1cfdec0956bb16ca716e88db0d45eff0 | 45 | py | Python | agescx/utilities/__init__.py | dderevjanik/agescx | 32e1b11c7c4205a63a156b0014ec7143c0d0c13b | [
"MIT"
] | 15 | 2016-02-08T19:35:46.000Z | 2021-11-24T06:52:04.000Z | agescx/utilities/__init__.py | heinezen/agescx | 32e1b11c7c4205a63a156b0014ec7143c0d0c13b | [
"MIT"
] | 1 | 2016-01-03T02:54:46.000Z | 2016-01-03T02:54:46.000Z | agescx/utilities/__init__.py | heinezen/agescx | 32e1b11c7c4205a63a156b0014ec7143c0d0c13b | [
"MIT"
] | 5 | 2016-10-05T03:55:29.000Z | 2021-05-14T10:15:57.000Z | from .decoder import *
from .encoder import * | 22.5 | 22 | 0.755556 | from .decoder import *
from .encoder import * | true | true |
1c3469fafd50acdfdbefde198aacc4a1c9a4969b | 5,482 | py | Python | model/densenet169/model3_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | 3 | 2018-05-06T15:15:21.000Z | 2018-05-13T12:31:42.000Z | model/densenet169/model3_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | model/densenet169/model3_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | import math
import os
import queue
import time
import keras
from keras.layers import Dense, BatchNormalization, Activation
import config
from util import data_loader
from util import keras_util
from util.keras_util import KerasModelConfig
model_config = KerasModelConfig(k_fold_file="1.txt",
... | 48.513274 | 119 | 0.541955 | import math
import os
import queue
import time
import keras
from keras.layers import Dense, BatchNormalization, Activation
import config
from util import data_loader
from util import keras_util
from util.keras_util import KerasModelConfig
model_config = KerasModelConfig(k_fold_file="1.txt",
... | true | true |
1c346a04d5deace26f5d13429cd06afeab172022 | 1,196 | py | Python | tests/formatters/winlnk.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | 27 | 2019-04-05T12:01:49.000Z | 2022-02-08T02:26:25.000Z | tests/formatters/winlnk.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | tests/formatters/winlnk.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | 8 | 2019-11-28T08:06:34.000Z | 2020-08-29T13:53:30.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Windows Shortcut (LNK) event formatter."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import winlnk
from tests.formatters import test_lib
class WinLnkLinkFormatterTest(test_lib.EventFormatterTestCase):
"""Tests fo... | 29.170732 | 73 | 0.736622 |
from __future__ import unicode_literals
import unittest
from plaso.formatters import winlnk
from tests.formatters import test_lib
class WinLnkLinkFormatterTest(test_lib.EventFormatterTestCase):
def testInitialization(self):
event_formatter = winlnk.WinLnkLinkFormatter()
self.assertIsNotNone(event_for... | true | true |
1c346c37b76708e41519df306a01018e1fdc6a4c | 59,987 | py | Python | pygments/lexers/_mapping.py | eric-wieser/pygments | 97dce6024f82402916c8212172180227630b9fdb | [
"BSD-2-Clause"
] | null | null | null | pygments/lexers/_mapping.py | eric-wieser/pygments | 97dce6024f82402916c8212172180227630b9fdb | [
"BSD-2-Clause"
] | null | null | null | pygments/lexers/_mapping.py | eric-wieser/pygments | 97dce6024f82402916c8212172180227630b9fdb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers._mapping
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer mapping definitions. This file is generated by itself. Everytime
you change something on a builtin lexer definition, run this script from
the lexers folder to update it.
Do not alter the LEXERS dictionary by ha... | 109.265938 | 351 | 0.577975 |
LEXERS = {
'ABAPLexer': ('pygments.lexers.business', 'ABAP', ('abap',), ('*.abap', '*.ABAP'), ('text/x-abap',)),
'APLLexer': ('pygments.lexers.apl', 'APL', ('apl',), ('*.apl',), ()),
'AbnfLexer': ('pygments.lexers.grammar_notation', 'ABNF', ('abnf',), ('*.abnf',), ('text/x-abnf',)),
'ActionScript3Lexe... | true | true |
1c346ccbc2ec03e804b8690df4aaf5a79f452a53 | 4,003 | py | Python | torchtext/datasets/multi30k.py | abhinavarora/text | 69f67f3a775f3d3c6f85cfaa4ac3819500b90696 | [
"BSD-3-Clause"
] | 1 | 2022-01-03T17:30:57.000Z | 2022-01-03T17:30:57.000Z | torchtext/datasets/multi30k.py | abhinavarora/text | 69f67f3a775f3d3c6f85cfaa4ac3819500b90696 | [
"BSD-3-Clause"
] | null | null | null | torchtext/datasets/multi30k.py | abhinavarora/text | 69f67f3a775f3d3c6f85cfaa4ac3819500b90696 | [
"BSD-3-Clause"
] | null | null | null | import os
from typing import Union, Tuple
from torchtext._internal.module_utils import is_module_available
from torchtext.data.datasets_utils import (
_wrap_split_argument,
_create_dataset_directory,
)
if is_module_available("torchdata"):
from torchdata.datapipes.iter import FileOpener, HttpReader, Iterab... | 36.390909 | 120 | 0.697977 | import os
from typing import Union, Tuple
from torchtext._internal.module_utils import is_module_available
from torchtext.data.datasets_utils import (
_wrap_split_argument,
_create_dataset_directory,
)
if is_module_available("torchdata"):
from torchdata.datapipes.iter import FileOpener, HttpReader, Iterab... | true | true |
1c346ccc639aafba00553b5a8aedab756185ab64 | 523 | py | Python | neuroscout/schemas/run.py | jdkent/neuroscout | 67aaafdf883988e2048197dc9ce4559a28e3b7b6 | [
"BSD-3-Clause"
] | null | null | null | neuroscout/schemas/run.py | jdkent/neuroscout | 67aaafdf883988e2048197dc9ce4559a28e3b7b6 | [
"BSD-3-Clause"
] | null | null | null | neuroscout/schemas/run.py | jdkent/neuroscout | 67aaafdf883988e2048197dc9ce4559a28e3b7b6 | [
"BSD-3-Clause"
] | null | null | null | from marshmallow import fields, Schema
class RunSchema(Schema):
id = fields.Int()
session = fields.Str(description='Session number')
acquisition = fields.Str(description='Acquisition')
subject = fields.Str(description='Subject id')
number = fields.Int(description='Run id')
duration = fields.Nu... | 37.357143 | 74 | 0.705545 | from marshmallow import fields, Schema
class RunSchema(Schema):
id = fields.Int()
session = fields.Str(description='Session number')
acquisition = fields.Str(description='Acquisition')
subject = fields.Str(description='Subject id')
number = fields.Int(description='Run id')
duration = fields.Nu... | true | true |
1c346d4bffe12f88b08655315c1a9c1a84f8d177 | 3,207 | py | Python | Python Code/Wh_manage-master/Wh_manage-master/wh_manage/wh_manage/settings.py | AkashKV-1998/Warehouse-Management-System | 33d96c52064262156ddcd459a36e2f63d4df2c30 | [
"Apache-2.0"
] | 3 | 2021-09-05T16:09:58.000Z | 2022-03-25T14:32:34.000Z | Python Code/Wh_manage-master/Wh_manage-master/wh_manage/wh_manage/settings.py | AkashKV-1998/Warehouse-Management-System | 33d96c52064262156ddcd459a36e2f63d4df2c30 | [
"Apache-2.0"
] | null | null | null | Python Code/Wh_manage-master/Wh_manage-master/wh_manage/wh_manage/settings.py | AkashKV-1998/Warehouse-Management-System | 33d96c52064262156ddcd459a36e2f63d4df2c30 | [
"Apache-2.0"
] | null | null | null | """
Django settings for Warehouse_management project.
Generated by 'django-admin startproject' using Django 1.11.29.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
... | 25.251969 | 91 | 0.691612 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'h1x!iw)3+3pm9#(u(1i&gnzz$5pf(cqtdxh4)=oc(i6mpvel1x'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c346d5c9d8f8b214e1fb56b7cc527962c4a55ce | 428 | py | Python | losses/loss_utils.py | kevinleestone/mmstereo | 6757847000ed19cce607ce7537f2f38eed305cdd | [
"MIT"
] | null | null | null | losses/loss_utils.py | kevinleestone/mmstereo | 6757847000ed19cce607ce7537f2f38eed305cdd | [
"MIT"
] | null | null | null | losses/loss_utils.py | kevinleestone/mmstereo | 6757847000ed19cce607ce7537f2f38eed305cdd | [
"MIT"
] | null | null | null | # Copyright 2021 Toyota Research Institute. All rights reserved.
import torch
import torch.nn.functional as F
def null_loss():
return None, False
def dummy_loss(tensor):
tensor[torch.isnan(tensor)] = 0.0
return F.mse_loss(tensor, torch.zeros_like(tensor)) * 0.0, False
def valid_loss(tensor):
if ... | 20.380952 | 68 | 0.698598 |
import torch
import torch.nn.functional as F
def null_loss():
return None, False
def dummy_loss(tensor):
tensor[torch.isnan(tensor)] = 0.0
return F.mse_loss(tensor, torch.zeros_like(tensor)) * 0.0, False
def valid_loss(tensor):
if not torch.any(torch.isnan(tensor)):
return tensor, True
... | true | true |
1c346daf5b5dda3bfe5c92e80639f17d67137efc | 1,275 | py | Python | setup.py | bradleycwojcik/euchre-cli | e4ffcdb16720d8dafe6b5b00b50eb923c1fcfe27 | [
"MIT"
] | 3 | 2020-10-07T08:23:12.000Z | 2021-11-20T16:33:40.000Z | setup.py | bradleycwojcik/euchre-cli | e4ffcdb16720d8dafe6b5b00b50eb923c1fcfe27 | [
"MIT"
] | 28 | 2020-07-14T01:29:33.000Z | 2021-11-20T04:48:09.000Z | setup.py | boldandbrad/euchre-cli | 6e03f76c5feb50d677ab2558707182fa7dd5d127 | [
"MIT"
] | 4 | 2020-09-07T04:25:04.000Z | 2021-11-11T07:20:01.000Z | from setuptools import setup, find_packages
# parse version number from euchre/__init__.py:
with open("euchre/__init__.py") as f:
info = {}
for line in f.readlines():
if line.startswith("version"):
exec(line, info)
break
setup_info = dict(
name="euchre-cli",
version=inf... | 31.097561 | 88 | 0.630588 | from setuptools import setup, find_packages
with open("euchre/__init__.py") as f:
info = {}
for line in f.readlines():
if line.startswith("version"):
exec(line, info)
break
setup_info = dict(
name="euchre-cli",
version=info["version"],
author="Bradley Wojcik",
... | true | true |
1c346df455707f69e3f5aae30b421c4f65357cdb | 6,382 | py | Python | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/4-extending_bound_16.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/4-extending_bound_16.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/4-extending_bound_16.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 37.763314 | 89 | 0.629583 | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | true | true |
1c346f4f180311b92db628086017ec37d9afda89 | 181,096 | py | Python | wagtail/core/models/__init__.py | swilltec/wagtail | 7e41ee8706caa65d94b0c59676a7f614bb9ae4d1 | [
"BSD-3-Clause"
] | null | null | null | wagtail/core/models/__init__.py | swilltec/wagtail | 7e41ee8706caa65d94b0c59676a7f614bb9ae4d1 | [
"BSD-3-Clause"
] | null | null | null | wagtail/core/models/__init__.py | swilltec/wagtail | 7e41ee8706caa65d94b0c59676a7f614bb9ae4d1 | [
"BSD-3-Clause"
] | null | null | null | """
wagtail.core.models is split into submodules for maintainability. All definitions intended as
public should be imported here (with 'noqa' comments as required) and outside code should continue
to import them from wagtail.core.models (e.g. `from wagtail.core.models import Site`, not
`from wagtail.core.models.sites i... | 40.163229 | 278 | 0.631461 |
import functools
import json
import logging
import uuid
from io import StringIO
from urllib.parse import urlparse
from django import forms
from django.apps import apps
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType
from django.... | true | true |
1c346f8c3402e5acc7704116e8651576d52dd5b9 | 141 | py | Python | glim_extensions/db/utils.py | aacanakin/glim-extensions | 75cf1e857abd717645db85f273650c0d883c55f2 | [
"MIT"
] | 2 | 2015-01-06T19:21:44.000Z | 2019-06-14T13:04:51.000Z | glim_extensions/db/utils.py | aacanakin/glim-extensions | 75cf1e857abd717645db85f273650c0d883c55f2 | [
"MIT"
] | 2 | 2015-02-20T07:40:47.000Z | 2015-02-20T07:44:42.000Z | glim_extensions/db/utils.py | aacanakin/glim-extensions | 75cf1e857abd717645db85f273650c0d883c55f2 | [
"MIT"
] | null | null | null | import os
def touch(path):
fhandle = open(path, 'a')
try:
os.utime(path, None)
finally:
fhandle.close()
return os.path.isfile(path)
| 14.1 | 28 | 0.673759 | import os
def touch(path):
fhandle = open(path, 'a')
try:
os.utime(path, None)
finally:
fhandle.close()
return os.path.isfile(path)
| true | true |
1c34700952baaf13572909a34a40765b9701b692 | 69,015 | py | Python | nova/virt/xenapi/vm_utils.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | null | null | null | nova/virt/xenapi/vm_utils.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | null | null | null | nova/virt/xenapi/vm_utils.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2011 Piston Cloud Computing, 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
#... | 39.101983 | 79 | 0.584598 |
"""
Helper methods for operations related to the management of VM records and
their attributes like VDIs, VIFs, as well as their lookup functions.
"""
import contextlib
import json
import os
import pickle
import re
import sys
import tempfile
import time
import urllib
import uuid
from decimal import De... | false | true |
1c34700a448f47b1743fd71647ab3fbfaa3323ec | 2,400 | py | Python | test.py | speedcell4/pytorch-noreward-rl | b889d78b7b2115feb80198c90e75e35956eae284 | [
"MIT"
] | null | null | null | test.py | speedcell4/pytorch-noreward-rl | b889d78b7b2115feb80198c90e75e35956eae284 | [
"MIT"
] | null | null | null | test.py | speedcell4/pytorch-noreward-rl | b889d78b7b2115feb80198c90e75e35956eae284 | [
"MIT"
] | null | null | null | import pickle
import time
from collections import deque
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import env_wrapper
from model import ActorCritic
def test(rank, args, shared_model):
torch.manual_seed(args.seed + rank)
env = env_wrapper.create_doom(args.record, outdir=... | 30 | 91 | 0.585833 | import pickle
import time
from collections import deque
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import env_wrapper
from model import ActorCritic
def test(rank, args, shared_model):
torch.manual_seed(args.seed + rank)
env = env_wrapper.create_doom(args.record, outdir=... | true | true |
1c3470d827c40a69d453b9d1c08c8a9036f3fde5 | 703 | py | Python | benchmarks/benchmark_msgpackrpc.py | brglng/aiorpc | 575a898e54e61cd73ec5cf2b48348e70cfaa5b41 | [
"WTFPL"
] | 66 | 2016-10-17T19:16:44.000Z | 2022-02-26T01:10:06.000Z | benchmarks/benchmark_msgpackrpc.py | webclinic017/aiorpc | a46929d70f17a6a98ee8f071012656f57bcd073b | [
"WTFPL"
] | 25 | 2018-05-13T03:14:43.000Z | 2022-03-03T03:29:04.000Z | benchmarks/benchmark_msgpackrpc.py | webclinic017/aiorpc | a46929d70f17a6a98ee8f071012656f57bcd073b | [
"WTFPL"
] | 20 | 2017-09-13T17:04:21.000Z | 2022-02-03T12:26:25.000Z | # -*- coding: utf-8 -*-
import time
import msgpackrpc
import multiprocessing
NUM_CALLS = 10000
def run_sum_server():
class SumServer(object):
def sum(self, x, y):
return x + y
server = msgpackrpc.Server(SumServer())
server.listen(msgpackrpc.Address("localhost", 6000))
server.star... | 19 | 69 | 0.633001 |
import time
import msgpackrpc
import multiprocessing
NUM_CALLS = 10000
def run_sum_server():
class SumServer(object):
def sum(self, x, y):
return x + y
server = msgpackrpc.Server(SumServer())
server.listen(msgpackrpc.Address("localhost", 6000))
server.start()
def call():
c... | true | true |
1c34723774ef88f3e523e0d9e0ebd06168f81247 | 4,183 | py | Python | nypdbot/dotplacer.py | artdent/nypdbot | 6b2cc459aa9fa326dbb5297836eb6b3e92e53397 | [
"Apache-2.0"
] | null | null | null | nypdbot/dotplacer.py | artdent/nypdbot | 6b2cc459aa9fa326dbb5297836eb6b3e92e53397 | [
"Apache-2.0"
] | null | null | null | nypdbot/dotplacer.py | artdent/nypdbot | 6b2cc459aa9fa326dbb5297836eb6b3e92e53397 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Jacob Lee.
#
# 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, sof... | 36.373913 | 79 | 0.593354 |
import cgi
import tempfile
import pygraphviz as pgv
_TABLE_HTML = """<
<table cellspacing="0" cellborder="0">
<tr>%s</tr>
<tr><td colspan="%d">%s</td></tr>
<tr>%s</tr>
</table>
>"""
class DotPlacer(object):
def __init__(self):
self.node_id = 0
self.node_names = {}
self.... | true | true |
1c3473d2b9d25fbb8ba2ff4fdf3423f69a3d79d6 | 369 | py | Python | pkg/auth/schema.py | Krishap-s/Encrypt-Everywhere | cf1f6f32b856685e3d29679dbf66e20876d30313 | [
"MIT"
] | null | null | null | pkg/auth/schema.py | Krishap-s/Encrypt-Everywhere | cf1f6f32b856685e3d29679dbf66e20876d30313 | [
"MIT"
] | null | null | null | pkg/auth/schema.py | Krishap-s/Encrypt-Everywhere | cf1f6f32b856685e3d29679dbf66e20876d30313 | [
"MIT"
] | null | null | null | from pydantic import BaseModel, EmailStr
class AddUserSchema(BaseModel):
name:str
email:EmailStr
salt:str
encrypted_master_password:str
derived_key:str
class SignInSchema(BaseModel):
email:EmailStr
derived_key:str
class GetUserSchema(BaseModel):
_id:str
name:str
email:EmailStr... | 18.45 | 40 | 0.739837 | from pydantic import BaseModel, EmailStr
class AddUserSchema(BaseModel):
name:str
email:EmailStr
salt:str
encrypted_master_password:str
derived_key:str
class SignInSchema(BaseModel):
email:EmailStr
derived_key:str
class GetUserSchema(BaseModel):
_id:str
name:str
email:EmailStr... | true | true |
1c347404176b5a0bc11fe0ded7c3c7249503dfba | 65,462 | py | Python | trac/Lib/site-packages/docutils-0.9.1-py2.7.egg/docutils/nodes.py | thinkbase/PortableTrac | 9ea0210f6b88f135ef73f370b48127af0495b2d7 | [
"BSD-3-Clause"
] | 2 | 2015-08-06T04:19:21.000Z | 2020-04-29T23:52:10.000Z | trac/Lib/site-packages/docutils-0.9.1-py2.7.egg/docutils/nodes.py | thinkbase/PortableTrac | 9ea0210f6b88f135ef73f370b48127af0495b2d7 | [
"BSD-3-Clause"
] | null | null | null | trac/Lib/site-packages/docutils-0.9.1-py2.7.egg/docutils/nodes.py | thinkbase/PortableTrac | 9ea0210f6b88f135ef73f370b48127af0495b2d7 | [
"BSD-3-Clause"
] | null | null | null | # $Id: nodes.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Docutils document tree element class library.
Classes in CamelCase are abstract base classes or auxiliary classes. The one
exception is `Text`, for a text (... | 33.847983 | 79 | 0.604381 |
"""
Docutils document tree element class library.
Classes in CamelCase are abstract base classes or auxiliary classes. The one
exception is `Text`, for a text (PCDATA) node; uppercase is used to
differentiate from element classes. Classes in lower_case_with_underscores
are element classes, matching the XML elemen... | false | true |
1c34748d620a653ca09649749f7210e101fd1278 | 1,234 | py | Python | allennlp/training/metrics/average.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 1 | 2022-01-06T02:06:23.000Z | 2022-01-06T02:06:23.000Z | allennlp/training/metrics/average.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 52 | 2020-11-11T13:08:25.000Z | 2021-12-16T13:04:30.000Z | allennlp/training/metrics/average.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | null | null | null | from allennlp.training.metrics.metric import Metric
from allennlp.nn.util import dist_reduce_sum
@Metric.register("average")
class Average(Metric):
"""
This [`Metric`](./metric.md) breaks with the typical `Metric` API and just stores values that were
computed in some fashion outside of a `Metric`. If you... | 28.697674 | 102 | 0.622366 | from allennlp.training.metrics.metric import Metric
from allennlp.nn.util import dist_reduce_sum
@Metric.register("average")
class Average(Metric):
def __init__(self) -> None:
self._total_value = 0.0
self._count = 0
def __call__(self, value):
self._count += dist_reduce_sum(1)
... | true | true |
1c3474e689134df0fd4ac4bf9c158084911a2b25 | 12,265 | py | Python | inference-engine/ie_bridges/python/tests/test_IENetwork.py | NikDemoShow/openvino | 31907e51e96f1603753dc69811bdf738374ca5e6 | [
"Apache-2.0"
] | 1 | 2022-02-10T08:05:09.000Z | 2022-02-10T08:05:09.000Z | inference-engine/ie_bridges/python/tests/test_IENetwork.py | NikDemoShow/openvino | 31907e51e96f1603753dc69811bdf738374ca5e6 | [
"Apache-2.0"
] | 105 | 2020-06-04T00:23:29.000Z | 2022-02-21T13:04:33.000Z | inference-engine/ie_bridges/python/tests/test_IENetwork.py | NikDemoShow/openvino | 31907e51e96f1603753dc69811bdf738374ca5e6 | [
"Apache-2.0"
] | 3 | 2021-04-25T06:52:41.000Z | 2021-05-07T02:01:44.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
import warnings
from openvino.inference_engine import IECore, IENetwork, DataPtr, InputInfoPtr, PreProcessInfo
from conftest import model_path
test_net_xml, test_net_bin = model_path()
def test_create_ie_netw... | 39.310897 | 106 | 0.613208 |
import os
import pytest
import warnings
from openvino.inference_engine import IECore, IENetwork, DataPtr, InputInfoPtr, PreProcessInfo
from conftest import model_path
test_net_xml, test_net_bin = model_path()
def test_create_ie_network_deprecated():
with warnings.catch_warnings(record=True) as w:
ne... | true | true |
1c34782fa214c3c817dce5a5206ad0051feb3f7b | 5,311 | py | Python | pettingzoo/classic/tictactoe/tictactoe.py | AbhijeetKrishnan/PettingZoo | d1a68923cef108b92012bfaaf2f083c839213d9f | [
"Apache-2.0"
] | 1 | 2021-05-27T05:30:10.000Z | 2021-05-27T05:30:10.000Z | pettingzoo/classic/tictactoe/tictactoe.py | AbhijeetKrishnan/PettingZoo | d1a68923cef108b92012bfaaf2f083c839213d9f | [
"Apache-2.0"
] | null | null | null | pettingzoo/classic/tictactoe/tictactoe.py | AbhijeetKrishnan/PettingZoo | d1a68923cef108b92012bfaaf2f083c839213d9f | [
"Apache-2.0"
] | null | null | null | from pettingzoo import AECEnv
from pettingzoo.utils import agent_selector
from gym import spaces
import numpy as np
import warnings
from pettingzoo.utils import wrappers
from .board import Board
def env():
env = raw_env()
env = wrappers.CaptureStdoutWrapper(env)
env = wrappers.TerminateIllegalWrapper(en... | 35.172185 | 113 | 0.548296 | from pettingzoo import AECEnv
from pettingzoo.utils import agent_selector
from gym import spaces
import numpy as np
import warnings
from pettingzoo.utils import wrappers
from .board import Board
def env():
env = raw_env()
env = wrappers.CaptureStdoutWrapper(env)
env = wrappers.TerminateIllegalWrapper(en... | true | true |
1c3478685033008557db52af634886c3a839281b | 12,397 | py | Python | src/oci/bds/models/bds_metastore_configuration.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/bds/models/bds_metastore_configuration.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/bds/models/bds_metastore_configuration.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 36.037791 | 245 | 0.674034 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class BdsMetastoreConfiguration(object):
METASTORE_TYPE_LOCAL = "LOCAL"
METASTORE_TYPE_EXTERNAL = "EXT... | true | true |
1c3478bbe14778e56f347b0fc81f273cc23619f8 | 37,447 | py | Python | run_classifier.py | kunde122/bert | def0a6534b77de915c5d39b2ffd05fd19ac3f2f2 | [
"Apache-2.0"
] | null | null | null | run_classifier.py | kunde122/bert | def0a6534b77de915c5d39b2ffd05fd19ac3f2f2 | [
"Apache-2.0"
] | null | null | null | run_classifier.py | kunde122/bert | def0a6534b77de915c5d39b2ffd05fd19ac3f2f2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 35.194549 | 82 | 0.681603 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import csv
import os
import modeling
import optimization
import tokenization
import tensorflow as tf
flags = tf.flags
FLAGS = flags.FLAGS
"data_dir", None,
"The inp... | true | true |
1c34792b7c909732c8e6e2de13ded7b83a1de10b | 35,897 | py | Python | scripts/bicorr_plot.py | pfschus/fission_bicorrelation | 103d1d6e93f722c73e33a9af773dd7ebbf4c6f25 | [
"MIT"
] | 1 | 2018-02-26T00:40:29.000Z | 2018-02-26T00:40:29.000Z | scripts/bicorr_plot.py | pfschus/fission_bicorrelation | 103d1d6e93f722c73e33a9af773dd7ebbf4c6f25 | [
"MIT"
] | null | null | null | scripts/bicorr_plot.py | pfschus/fission_bicorrelation | 103d1d6e93f722c73e33a9af773dd7ebbf4c6f25 | [
"MIT"
] | null | null | null | """
Plotting functions for Bicorr project
Moving them here to keep the bicorr.py file cleaner
PFS, March 2018
Changelog:
2018_03_15: Move a few functions here
"""
import matplotlib
#matplotlib.use('agg') # for flux
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib.pyplot import cm
fro... | 35.682903 | 162 | 0.608853 |
import matplotlib
tplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib.pyplot import cm
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator)
import seaborn as sns
sns.set(style='ticks')
import sys
import os
import os.path
import scipy.io as sio
import time
import n... | true | true |
1c3479b242c45478096faa4c288a0868f284cab4 | 960 | py | Python | ICHSACTF2021/Crypto/Baby_Homework.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | null | null | null | ICHSACTF2021/Crypto/Baby_Homework.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | null | null | null | ICHSACTF2021/Crypto/Baby_Homework.py | yl-ang/CTF | a075231a3dc32630a26f3b2d4dfc1dd9b9f1e0b9 | [
"MIT"
] | 3 | 2021-06-28T09:52:07.000Z | 2021-09-22T03:28:40.000Z | # AES ECB -- One byte at a time attack
from pwn import *
def main(data):
host = 'baby_homework.ichsa.ctf.today'
port = 8010
t = remote(host, port)
t.sendline(data)
t.recvuntil("Hello! What do you want to encrypt today?\n")
a = t.recvline()[36:38]
return a
if __name__ == '__main__':
... | 26.666667 | 62 | 0.496875 |
from pwn import *
def main(data):
host = 'baby_homework.ichsa.ctf.today'
port = 8010
t = remote(host, port)
t.sendline(data)
t.recvuntil("Hello! What do you want to encrypt today?\n")
a = t.recvline()[36:38]
return a
if __name__ == '__main__':
flag ="d0n7_7ruzt_DeF4uL7_V4l... | true | true |
1c3479bd4399e34cb2e02d3a0bdb6bf445aa0d20 | 2,367 | py | Python | compressor/utils/__init__.py | gatherhealth/django-compressor | 2eea7b1a71855cfc8e44f12301d85057f2bb70e6 | [
"Apache-2.0"
] | 10 | 2016-09-14T21:58:51.000Z | 2019-01-28T21:56:37.000Z | compressor/utils/__init__.py | gatherhealth/django-compressor | 2eea7b1a71855cfc8e44f12301d85057f2bb70e6 | [
"Apache-2.0"
] | 6 | 2020-06-05T18:44:19.000Z | 2022-01-13T00:48:56.000Z | compressor/utils/__init__.py | gatherhealth/django-compressor | 2eea7b1a71855cfc8e44f12301d85057f2bb70e6 | [
"Apache-2.0"
] | 1 | 2020-10-01T04:11:41.000Z | 2020-10-01T04:11:41.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.utils import six
from compressor.exceptions import FilterError
def get_class(class_string, exception=FilterError):
"""
Convert a string version of a function name to the callable object.
"""
if not hasattr(class_st... | 31.986486 | 83 | 0.634981 |
from __future__ import unicode_literals
import os
from django.utils import six
from compressor.exceptions import FilterError
def get_class(class_string, exception=FilterError):
if not hasattr(class_string, '__bases__'):
try:
class_string = str(class_string)
mod_name, class_name ... | true | true |
1c347a5748f1cbdeca0be005d1cc1b785ac0a408 | 1,305 | py | Python | tools/perf/measurements/skpicture_printer_unittest.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | tools/perf/measurements/skpicture_printer_unittest.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | tools/perf/measurements/skpicture_printer_unittest.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # 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.
import shutil
import tempfile
from telemetry import decorators
from telemetry.testing import options_for_unittests
from telemetry.testing import page_test_t... | 33.461538 | 75 | 0.783908 |
import shutil
import tempfile
from telemetry import decorators
from telemetry.testing import options_for_unittests
from telemetry.testing import page_test_test_case
from measurements import skpicture_printer
class SkpicturePrinterUnitTest(page_test_test_case.PageTestTestCase):
def setUp(self):
self._opti... | true | true |
1c347aeb2574f0b090ef4fa205fee79639bf5b68 | 1,312 | py | Python | Semana8/Vehiculos/controllers/vehiculo.py | GuidoTorres/codigo8 | 7fdff4f677f048de7d7877b96ec3a688d3dde163 | [
"MIT"
] | null | null | null | Semana8/Vehiculos/controllers/vehiculo.py | GuidoTorres/codigo8 | 7fdff4f677f048de7d7877b96ec3a688d3dde163 | [
"MIT"
] | 40 | 2021-03-10T16:58:17.000Z | 2022-03-26T01:55:17.000Z | Semana8/Vehiculos/controllers/vehiculo.py | GuidoTorres/codigo8 | 7fdff4f677f048de7d7877b96ec3a688d3dde163 | [
"MIT"
] | null | null | null | from flask_restful import Resource, reqparse
from Vehiculos.models.vehiculo import VehiculoModel
class Vehiculo(Resource):
parser = reqparse.RequestParser()
parser.add_argument(
'marca_vehiculo',
type= str,
required = True,
help = "Falta la marca_vehiculo"
)
... | 29.818182 | 101 | 0.586128 | from flask_restful import Resource, reqparse
from Vehiculos.models.vehiculo import VehiculoModel
class Vehiculo(Resource):
parser = reqparse.RequestParser()
parser.add_argument(
'marca_vehiculo',
type= str,
required = True,
help = "Falta la marca_vehiculo"
)
... | true | true |
1c347af37a69df9363c6020ad91cc40569857713 | 323 | py | Python | vulcan/builder/__init__.py | exrny/vulcan-builder | b0b397202e2a82acc2794a01fc2029e61f411f1c | [
"MIT"
] | null | null | null | vulcan/builder/__init__.py | exrny/vulcan-builder | b0b397202e2a82acc2794a01fc2029e61f411f1c | [
"MIT"
] | null | null | null | vulcan/builder/__init__.py | exrny/vulcan-builder | b0b397202e2a82acc2794a01fc2029e61f411f1c | [
"MIT"
] | null | null | null | '''
Lightweight Python Build Tool
'''
from vulcan.builder.common import nsh, dump, dumps, safe_cd
from ._vb import task, async_task, main
import sh
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__all__ = [
'task', 'async_task',
'main',
'nsh', 'sh',
'dump', 'dumps',
'safe_cd'
... | 17 | 59 | 0.662539 |
from vulcan.builder.common import nsh, dump, dumps, safe_cd
from ._vb import task, async_task, main
import sh
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__all__ = [
'task', 'async_task',
'main',
'nsh', 'sh',
'dump', 'dumps',
'safe_cd'
]
| true | true |
1c347b4c2c1741836278dc153755824a8a53fc7f | 6,954 | py | Python | sdk/python/kubeflow/training/models/v1_tf_job_spec.py | pingsutw/tf-operator | abfecef0ac5d84ba62705de556f392e9b6f60027 | [
"Apache-2.0"
] | null | null | null | sdk/python/kubeflow/training/models/v1_tf_job_spec.py | pingsutw/tf-operator | abfecef0ac5d84ba62705de556f392e9b6f60027 | [
"Apache-2.0"
] | null | null | null | sdk/python/kubeflow/training/models/v1_tf_job_spec.py | pingsutw/tf-operator | abfecef0ac5d84ba62705de556f392e9b6f60027 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
tensorflow
Python SDK for tensorflow # noqa: E501
The version of the OpenAPI document: v1.3.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubeflow.training.configuration import Configuration
class V1TFJobSpec(object... | 33.594203 | 190 | 0.628415 |
import pprint
import re
import six
from kubeflow.training.configuration import Configuration
class V1TFJobSpec(object):
openapi_types = {
'enable_dynamic_worker': 'bool',
'run_policy': 'V1RunPolicy',
'success_policy': 'str',
'tf_replica_specs': 'dict(str, V1ReplicaSpec)'
... | true | true |
1c347c16656536df69e4c8817e1ab4b095cd912d | 6,220 | py | Python | MoodleMediaConverter.py | MichaelMueller/MoodleMediaConverter | f6087942146d312088417badf406aacca95764fb | [
"Apache-2.0"
] | null | null | null | MoodleMediaConverter.py | MichaelMueller/MoodleMediaConverter | f6087942146d312088417badf406aacca95764fb | [
"Apache-2.0"
] | null | null | null | MoodleMediaConverter.py | MichaelMueller/MoodleMediaConverter | f6087942146d312088417badf406aacca95764fb | [
"Apache-2.0"
] | null | null | null | import argparse
import datetime
import hashlib
import os
import shutil
import subprocess
import sys
import tempfile
import zipfile
from time import sleep, time
import time
from zipfile import ZipFile
import xml.etree.ElementTree as ET
def find_file(name, path):
for root, dirs, files in os.walk(path):
if n... | 36.162791 | 117 | 0.632958 | import argparse
import datetime
import hashlib
import os
import shutil
import subprocess
import sys
import tempfile
import zipfile
from time import sleep, time
import time
from zipfile import ZipFile
import xml.etree.ElementTree as ET
def find_file(name, path):
for root, dirs, files in os.walk(path):
if n... | true | true |
1c347ce204585efb3f6cd25b73a53ec550c91616 | 10,256 | py | Python | docs/source/conf.py | Shray64/pytorch_connectomics | d6c814f11ac2f8418ede5ae220a93016f50214fc | [
"MIT"
] | null | null | null | docs/source/conf.py | Shray64/pytorch_connectomics | d6c814f11ac2f8418ede5ae220a93016f50214fc | [
"MIT"
] | null | null | null | docs/source/conf.py | Shray64/pytorch_connectomics | d6c814f11ac2f8418ede5ae220a93016f50214fc | [
"MIT"
] | null | null | null | # Based on https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are comment... | 29.136364 | 92 | 0.699883 |
import sys, os
import datetime
import sphinx_rtd_theme
import doctest
import connectomics
needs_sphinx = '3.0'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sph... | true | true |
1c347ce2892aa8cfa6ed998db4ec47574d239ba8 | 43,747 | py | Python | tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/cashflow_streams.py | slowy07/tf-quant-finance | 0976f720fb58a2d7bfd863640c12a2425cd2f94f | [
"Apache-2.0"
] | 1 | 2021-03-04T01:07:48.000Z | 2021-03-04T01:07:48.000Z | tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/cashflow_streams.py | Aarif1430/tf-quant-finance | 9372eb1ddf2b48cb1a3d4283bc67a10647ddc7a6 | [
"Apache-2.0"
] | null | null | null | tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/cashflow_streams.py | Aarif1430/tf-quant-finance | 9372eb1ddf2b48cb1a3d4283bc67a10647ddc7a6 | [
"Apache-2.0"
] | 1 | 2021-02-16T12:08:41.000Z | 2021-02-16T12:08:41.000Z | # Lint as: python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 43.058071 | 107 | 0.68135 |
from typing import Optional, Tuple, Callable, Any, List, Union
import numpy as np
import tensorflow.compat.v2 as tf
from tf_quant_finance import datetime as dateslib
from tf_quant_finance.experimental.pricing_platform.framework.core import curve_types as curve_types_lib
from tf_quant_finance.experiment... | true | true |
1c347d0430732c04a85547fa02506a3e4316f01c | 22,159 | py | Python | external/devlib/devlib/module/cpufreq.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | null | null | null | external/devlib/devlib/module/cpufreq.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | null | null | null | external/devlib/devlib/module/cpufreq.py | qais-yousef/lisa | 8343e26bf0565589928a69ccbe67b1be03403db7 | [
"Apache-2.0"
] | 1 | 2021-01-27T05:21:15.000Z | 2021-01-27T05:21:15.000Z | # Copyright 2014-2018 ARM Limited
#
# 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 w... | 41.574109 | 115 | 0.601381 |
from contextlib import contextmanager
from devlib.module import Module
from devlib.exception import TargetStableError
from devlib.utils.misc import memoized
WRITE_ONLY_TUNABLES = {
'interactive': ['boostpulse']
}
class CpufreqModule(Module):
name = 'cpufreq'
@staticmethod
def probe... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.