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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3423dccd807fb1332a750f36dae9ff22191dc5 | 92,796 | py | Python | unittests/test_rest_framework.py | maerifat/django-DefectDojo | ba1a415219ff20e8b4e909ef14f750de9b80297e | [
"BSD-3-Clause"
] | null | null | null | unittests/test_rest_framework.py | maerifat/django-DefectDojo | ba1a415219ff20e8b4e909ef14f750de9b80297e | [
"BSD-3-Clause"
] | 206 | 2020-04-20T16:03:18.000Z | 2022-01-15T23:07:48.000Z | unittests/test_rest_framework.py | maerifat/django-DefectDojo | ba1a415219ff20e8b4e909ef14f750de9b80297e | [
"BSD-3-Clause"
] | 1 | 2020-12-06T15:44:44.000Z | 2020-12-06T15:44:44.000Z | from collections import OrderedDict
from drf_spectacular.drainage import GENERATOR_STATS
# from drf_spectacular.renderers import OpenApiJsonRenderer
from unittest.mock import call, patch, ANY
from dojo.models import Product, Engagement, Test, Finding, \
JIRA_Issue, Tool_Product_Settings, Tool_Configuration, Tool_Ty... | 40.504583 | 140 | 0.621255 | from collections import OrderedDict
from drf_spectacular.drainage import GENERATOR_STATS
from unittest.mock import call, patch, ANY
from dojo.models import Product, Engagement, Test, Finding, \
JIRA_Issue, Tool_Product_Settings, Tool_Configuration, Tool_Type, \
User, Stub_Finding, Endpoint, JIRA_Project, JIRA_I... | true | true |
1c34242f0b455f83fd1b2afa16dbd1a4e385d199 | 18,161 | py | Python | Civ4/Assets/Python/Screens/CvReligionScreen.py | f1rpo/Civ4CE | ba64c3545b479887739ad0ff78605b51b6fa57f9 | [
"CNRI-Python"
] | null | null | null | Civ4/Assets/Python/Screens/CvReligionScreen.py | f1rpo/Civ4CE | ba64c3545b479887739ad0ff78605b51b6fa57f9 | [
"CNRI-Python"
] | null | null | null | Civ4/Assets/Python/Screens/CvReligionScreen.py | f1rpo/Civ4CE | ba64c3545b479887739ad0ff78605b51b6fa57f9 | [
"CNRI-Python"
] | null | null | null | ## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
from CvPythonExtensions import *
import PyHelpers
import CvUtil
import ScreenInput
import CvScreenEnums
PyPlayer = PyHelpers.PyPlayer
# globals
gc = CyGlobalContext()
ArtFileMgr = CyArtFileMgr()
localText = CyTranslator()
class CvReligionSc... | 45.176617 | 358 | 0.729035 | ## Copyright Firaxis Games 2005
from CvPythonExtensions import *
import PyHelpers
import CvUtil
import ScreenInput
import CvScreenEnums
PyPlayer = PyHelpers.PyPlayer
# globals
gc = CyGlobalContext()
ArtFileMgr = CyArtFileMgr()
localText = CyTranslator()
class CvReligionScreen:
def __init__(self):
... | true | true |
1c34246ce637530967a2bee08f523a8a7a9369c3 | 320 | py | Python | fdk_client/platform/models/Closing.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/Closing.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/Closing.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class Closing(BaseSchema):
# Order swagger.json
hour = fields.Int(required=False)
minute = fields.Int(required=False)
| 14.545455 | 42 | 0.7 |
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class Closing(BaseSchema):
hour = fields.Int(required=False)
minute = fields.Int(required=False)
| true | true |
1c342489fb983dedab183c7013a31c7de3874fc7 | 456 | py | Python | thecut/pages/migrations/0003_auto_20160211_1514.py | exemplarysoftware/thecut-pagse | 94126622ec790721b0a05db0742bbc4c6733ba2c | [
"Apache-2.0"
] | null | null | null | thecut/pages/migrations/0003_auto_20160211_1514.py | exemplarysoftware/thecut-pagse | 94126622ec790721b0a05db0742bbc4c6733ba2c | [
"Apache-2.0"
] | null | null | null | thecut/pages/migrations/0003_auto_20160211_1514.py | exemplarysoftware/thecut-pagse | 94126622ec790721b0a05db0742bbc4c6733ba2c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0002_set_ondelete'),
]
operations = [
migrations.AlterField(
model_name='page',
name='url',... | 22.8 | 117 | 0.614035 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0002_set_ondelete'),
]
operations = [
migrations.AlterField(
model_name='page',
name='url',
field=model... | true | true |
1c3424aa4b61bdff7606f6972ad265b4e7b500d6 | 5,469 | py | Python | scripts/e271.py | JackKelly/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 38 | 2015-08-14T14:38:52.000Z | 2021-12-15T03:21:04.000Z | scripts/e271.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | null | null | null | scripts/e271.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 26 | 2015-09-24T20:55:26.000Z | 2021-12-07T15:42:09.000Z | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from neuralnilm.net import BidirectionalRecurrentLayer
from lasagne.nonlinearities import sigmoid, r... | 26.678049 | 109 | 0.674163 | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from neuralnilm.net import BidirectionalRecurrentLayer
from lasagne.nonlinearities import sigmoid, rectify, tanh
from lasagne.objectives import crossentrop... | true | true |
1c3425cee571a808d9c84539b9ebe5165cfce67e | 1,134 | py | Python | tests/test_set_attr.py | joinee0208/manim | 8e1407e7fd5c01258f75748cc947d31d67ffd92b | [
"MIT"
] | null | null | null | tests/test_set_attr.py | joinee0208/manim | 8e1407e7fd5c01258f75748cc947d31d67ffd92b | [
"MIT"
] | null | null | null | tests/test_set_attr.py | joinee0208/manim | 8e1407e7fd5c01258f75748cc947d31d67ffd92b | [
"MIT"
] | null | null | null | from __future__ import annotations
import numpy as np
from manim import config
from manim.constants import RIGHT
from manim.mobject.geometry import Square
def test_Data():
config.renderer = "opengl"
a = Square().move_to(RIGHT)
data_bb = a.data["bounding_box"]
assert np.array_equal(
data_bb,
... | 26.372093 | 88 | 0.62522 | from __future__ import annotations
import numpy as np
from manim import config
from manim.constants import RIGHT
from manim.mobject.geometry import Square
def test_Data():
config.renderer = "opengl"
a = Square().move_to(RIGHT)
data_bb = a.data["bounding_box"]
assert np.array_equal(
data_bb,
... | true | true |
1c3426d04076f8ffbda91a465f8b7007e6e7c23c | 13,436 | py | Python | userbot/plugins/stickers.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | userbot/plugins/stickers.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | userbot/plugins/stickers.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | """Make / Download Telegram Sticker Packs without installing Third Party applications
Available Commands:
.kangsticker [Optional Emoji]
.packinfo
.getsticker"""
from telethon import events
from io import BytesIO
from PIL import Image
import asyncio
import datetime
from collections import defaultdict
import m... | 39.751479 | 143 | 0.620572 | from telethon import events
from io import BytesIO
from PIL import Image
import asyncio
import datetime
from collections import defaultdict
import math
import os
import requests
import zipfile
from telethon.errors.rpcerrorlist import StickersetInvalidError
from telethon.errors import MessageNotModifiedError
... | true | true |
1c3427370eeee82128768c3f43bb6fff1f493fe1 | 20,617 | py | Python | keystoneclient/shell.py | citrix-openstack-build/python-keystoneclient | e170955d6de5cbf521d54105bdefaf606ccdb356 | [
"Apache-1.1"
] | null | null | null | keystoneclient/shell.py | citrix-openstack-build/python-keystoneclient | e170955d6de5cbf521d54105bdefaf606ccdb356 | [
"Apache-1.1"
] | null | null | null | keystoneclient/shell.py | citrix-openstack-build/python-keystoneclient | e170955d6de5cbf521d54105bdefaf606ccdb356 | [
"Apache-1.1"
] | null | null | null | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | 41.482897 | 79 | 0.51962 |
from __future__ import print_function
import argparse
import getpass
import os
import sys
import keystoneclient
from keystoneclient import access
from keystoneclient.contrib.bootstrap import shell as shell_bootstrap
from keystoneclient import exceptions as exc
from keystoneclient.generic import shell as shell_gene... | true | true |
1c3427fc0b2f89af9bf052f3f2803cfd4c032dfd | 7,351 | py | Python | bccs_dump.py | sasquatch-jr/bcldb_wholesale_cannabis_price_list | c39b6172a1ed34945361774a6cc0024e7a1393c1 | [
"MIT"
] | 8 | 2021-02-12T03:00:08.000Z | 2021-12-19T21:18:17.000Z | bccs_dump.py | sasquatch-jr/bcldb_wholesale_cannabis_price_list | c39b6172a1ed34945361774a6cc0024e7a1393c1 | [
"MIT"
] | null | null | null | bccs_dump.py | sasquatch-jr/bcldb_wholesale_cannabis_price_list | c39b6172a1ed34945361774a6cc0024e7a1393c1 | [
"MIT"
] | 6 | 2021-02-12T03:00:10.000Z | 2021-02-24T03:05:53.000Z | import csv
import time
import jinja2
import requests
from datetime import datetime
template = """<html>
<head><title>BCLDB Wholesale Cannabis Price List</title></head>
<body>
<h1>BCLDB Wholesale Cannabis Price List</h1>
<h2><a href="https://github.com/sasquatch-jr/bcldb_wholesale_cannabis_price_list/blob/main/README... | 41.067039 | 492 | 0.543736 | import csv
import time
import jinja2
import requests
from datetime import datetime
template = """<html>
<head><title>BCLDB Wholesale Cannabis Price List</title></head>
<body>
<h1>BCLDB Wholesale Cannabis Price List</h1>
<h2><a href="https://github.com/sasquatch-jr/bcldb_wholesale_cannabis_price_list/blob/main/README... | true | true |
1c3429d36012e6fbbc3345c7e7d976ddbaa9eef1 | 1,966 | py | Python | waveconverter.py | SMMoseley/Background_Colony_Noise | eb88ccf725939d501f02854b4c82659e8f6d5a3a | [
"MIT"
] | null | null | null | waveconverter.py | SMMoseley/Background_Colony_Noise | eb88ccf725939d501f02854b4c82659e8f6d5a3a | [
"MIT"
] | null | null | null | waveconverter.py | SMMoseley/Background_Colony_Noise | eb88ccf725939d501f02854b4c82659e8f6d5a3a | [
"MIT"
] | null | null | null | ##Packages##
import h5py as h5
import numpy as np
import pandas as pd
import os
import ewave
##Functions##
def wav_intervals(csv, sample_rate, hour_to_sample_rate):
for row in csv.itertuples(): #iterates through each row in the csv file
arf_file = row[0]
start_time = row[1]*hour_to_sample_rate #tak... | 50.410256 | 227 | 0.725331 | import h5py as h5
import numpy as np
import pandas as pd
import os
import ewave
def wav_intervals(csv, sample_rate, hour_to_sample_rate):
for row in csv.itertuples(): arf_file = row[0]
start_time = row[1]*hour_to_sample_rate duration = row[2]*sample_rate return arf_file, start_time, dur... | true | true |
1c342a98c9f0dd3f9df730fa05eb9f4315d5f656 | 503 | py | Python | leetcode/algorithm/roman_int.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:07:56.000Z | 2018-12-19T22:07:56.000Z | leetcode/algorithm/roman_int.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 12 | 2020-03-14T05:32:26.000Z | 2022-03-12T00:08:49.000Z | leetcode/algorithm/roman_int.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:08:00.000Z | 2018-12-19T22:08:00.000Z | """
@author: magician
@date: 2019/12/18
@file: roman_int.py
"""
def roman_to_int(s: str) -> int:
"""
roman_to_int
:param s:
:return:
"""
roman_dict = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000,
'... | 14.371429 | 39 | 0.399602 |
def roman_to_int(s: str) -> int:
roman_dict = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000,
'IV': 4,
'XL': 40,
'XC': 90,
'CD': 400,
'CM': 900,
}
return True
if __name__ == '__main__':
... | true | true |
1c342aefb37a2171edc1cc7cf09da1834a0464a8 | 2,461 | py | Python | examples/bank_reserves/bank_reserves/server.py | DoofCoder/mesa | b290439e4f68a1a5a4906246546b69e7d783dcfb | [
"Apache-2.0"
] | 2 | 2017-05-30T02:46:20.000Z | 2017-07-18T19:42:33.000Z | examples/bank_reserves/bank_reserves/server.py | DoofCoder/mesa | b290439e4f68a1a5a4906246546b69e7d783dcfb | [
"Apache-2.0"
] | 40 | 2019-08-07T13:57:52.000Z | 2022-03-18T05:21:42.000Z | examples/bank_reserves/bank_reserves/server.py | DoofCoder/mesa | b290439e4f68a1a5a4906246546b69e7d783dcfb | [
"Apache-2.0"
] | 2 | 2017-07-17T15:25:41.000Z | 2022-03-31T07:00:41.000Z | from mesa.visualization.ModularVisualization import ModularServer
from mesa.visualization.modules import CanvasGrid, ChartModule
from mesa.visualization.UserParam import UserSettableParameter
from bank_reserves.agents import Person
from bank_reserves.model import BankReserves
"""
Citation:
The following code was adapt... | 26.462366 | 88 | 0.663145 | from mesa.visualization.ModularVisualization import ModularServer
from mesa.visualization.modules import CanvasGrid, ChartModule
from mesa.visualization.UserParam import UserSettableParameter
from bank_reserves.agents import Person
from bank_reserves.model import BankReserves
RICH_COLOR = "#46FF33"
POOR_COLOR = "#FF3... | true | true |
1c342be00019af11edb90f23f188a1168dbdeff5 | 91 | py | Python | thirdparty/his_evaluators/his_evaluators/__init__.py | Puneet-G/Impersonator-NNProject | 980cfc260feebbc873b4150326791340f6526c42 | [
"MIT"
] | 1 | 2020-05-11T19:10:27.000Z | 2020-05-11T19:10:27.000Z | thirdparty/his_evaluators/his_evaluators/__init__.py | Puneet-G/Impersonator-NNProject | 980cfc260feebbc873b4150326791340f6526c42 | [
"MIT"
] | 4 | 2020-05-11T19:12:18.000Z | 2021-10-12T22:52:12.000Z | thirdparty/his_evaluators/his_evaluators/__init__.py | Puneet-G/Impersonator-NNProject | 980cfc260feebbc873b4150326791340f6526c42 | [
"MIT"
] | 1 | 2020-05-27T01:59:41.000Z | 2020-05-27T01:59:41.000Z | from .evaluators.motion_imitation import MotionImitationModel, IPERMotionImitationEvaluator | 91 | 91 | 0.923077 | from .evaluators.motion_imitation import MotionImitationModel, IPERMotionImitationEvaluator | true | true |
1c342c58860d1a2185286318dccd14166af7af0f | 94,847 | py | Python | plugins/modules/oci_compute_management_instance_configuration_actions.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_compute_management_instance_configuration_actions.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_compute_management_instance_configuration_actions.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 52.056531 | 160 | 0.49155 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_compute_management_instance_configuration_actions
short_description: Perform ac... | true | true |
1c342deba119b31588f50bdd551a7d92b6156a77 | 9,947 | py | Python | huskar_api/api/webhook.py | mowangdk/huskar | 7692fbc5672a5ae6e2a33616c493466a7137f8cd | [
"MIT"
] | 59 | 2019-10-31T10:50:10.000Z | 2021-11-26T04:32:25.000Z | huskar_api/api/webhook.py | mowangdk/huskar | 7692fbc5672a5ae6e2a33616c493466a7137f8cd | [
"MIT"
] | 5 | 2019-10-31T10:37:30.000Z | 2020-03-02T06:45:46.000Z | huskar_api/api/webhook.py | mowangdk/huskar | 7692fbc5672a5ae6e2a33616c493466a7137f8cd | [
"MIT"
] | 9 | 2019-10-31T10:35:00.000Z | 2019-12-01T14:13:58.000Z | from __future__ import absolute_import
import logging
import itertools
from operator import attrgetter
from flask import request, abort, g
from flask.views import MethodView
from huskar_api.models.webhook import Webhook
from huskar_api.models.audit import action_types
from huskar_api.models.auth import Application, ... | 35.909747 | 79 | 0.602493 | from __future__ import absolute_import
import logging
import itertools
from operator import attrgetter
from flask import request, abort, g
from flask.views import MethodView
from huskar_api.models.webhook import Webhook
from huskar_api.models.audit import action_types
from huskar_api.models.auth import Application, ... | true | true |
1c342e2d9df2872b510289962bb26ccf755e777c | 36,357 | py | Python | ios/dateparser/lib/python2.7/site-packages/jdatetime/__init__.py | mpercich/Calendarize | d658962d5d205f878afd9876cb64b5381964f112 | [
"MIT"
] | null | null | null | ios/dateparser/lib/python2.7/site-packages/jdatetime/__init__.py | mpercich/Calendarize | d658962d5d205f878afd9876cb64b5381964f112 | [
"MIT"
] | null | null | null | ios/dateparser/lib/python2.7/site-packages/jdatetime/__init__.py | mpercich/Calendarize | d658962d5d205f878afd9876cb64b5381964f112 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# jdatetime is (c) 2010-2011 Milad Rastian <eslashmili at gmail.com>.
# The jdatetime module was contributed to Python as of Python 2.7 and thus
# was licensed under the Python license. Same license applies to all files in
# the jdatetime package project.
from __future__ import unicode_literals
... | 32.724572 | 207 | 0.510191 | from __future__ import unicode_literals
import datetime as py_datetime
import sys
from jdatetime.jalali import \
GregorianToJalali, JalaliToGregorian, j_days_in_month
import re as _re
import locale as _locale
__VERSION__ = "1.8.1"
MINYEAR = 1
MAXYEAR = 9377
timedelta = py_datetime.timedelta
tzinfo = py_datetime.tz... | true | true |
1c342e64716b7de1c47b236f6f33e3aabef1b660 | 5,148 | py | Python | purity_fb/purity_fb_1dot10/models/smtp.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot10/models/smtp.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot10/models/smtp.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.10 Python SDK
Pure Storage FlashBlade REST 1.10 Python SDK. Compatible with REST API versions 1.0 - 1.10. Developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/... | 28.759777 | 251 | 0.578671 |
import pprint
import re
import six
class Smtp(object):
__test__ = False
swagger_types = {
'name': 'str',
'relay_host': 'str',
'sender_domain': 'str'
}
attribute_map = {
'name': 'name',
'relay_host': 'relay_host',
'sender_domain': 'sender_doma... | true | true |
1c342f10cd788b23e6e565736edc76b12871c407 | 10,337 | py | Python | app/api/services/game_services/service.py | Glyphack/tortuga | 42444a850c7587a01b75a2b13fae4a37e38ab79b | [
"MIT"
] | 5 | 2020-03-14T13:22:40.000Z | 2021-07-12T11:55:18.000Z | app/api/services/game_services/service.py | Glyphack/tortuga | 42444a850c7587a01b75a2b13fae4a37e38ab79b | [
"MIT"
] | 10 | 2020-04-01T16:28:49.000Z | 2021-02-27T09:06:07.000Z | app/api/services/game_services/service.py | Glyphack/tortuga | 42444a850c7587a01b75a2b13fae4a37e38ab79b | [
"MIT"
] | null | null | null | import random
from typing import List, Dict
from app.api.services import lobby_service
from app.models.event_cards import EventCardsManager
from app.models.game import Game, Player, Chests
from app.api.services.game_services.event_card_handlers import \
event_card_handlers
from app.models import votes
from app.mod... | 36.017422 | 113 | 0.666054 | import random
from typing import List, Dict
from app.api.services import lobby_service
from app.models.event_cards import EventCardsManager
from app.models.game import Game, Player, Chests
from app.api.services.game_services.event_card_handlers import \
event_card_handlers
from app.models import votes
from app.mod... | true | true |
1c342ff6f76ccebd538d0b8709c2672cdf7a8d9d | 3,145 | py | Python | image2emoticon/prepare_data.py | Tobigs-team/EmoGET_tobigticon | 4b13d6a780bbe269a9c285cc603b16b09d459edf | [
"Apache-2.0"
] | 11 | 2021-01-21T12:53:30.000Z | 2022-03-04T17:03:08.000Z | image2emoticon/prepare_data.py | Tobigs-team/EmoGET_tobigticon | 4b13d6a780bbe269a9c285cc603b16b09d459edf | [
"Apache-2.0"
] | null | null | null | image2emoticon/prepare_data.py | Tobigs-team/EmoGET_tobigticon | 4b13d6a780bbe269a9c285cc603b16b09d459edf | [
"Apache-2.0"
] | 8 | 2021-01-25T07:30:41.000Z | 2021-11-05T08:53:26.000Z | import argparse
from io import BytesIO
import multiprocessing
from functools import partial
from PIL import Image
import lmdb
from tqdm import tqdm
from torchvision import datasets
from torchvision.transforms import functional as trans_fn
import numpy as np
def resize_and_convert(img, size, resample, quality=100):
... | 29.669811 | 95 | 0.644197 | import argparse
from io import BytesIO
import multiprocessing
from functools import partial
from PIL import Image
import lmdb
from tqdm import tqdm
from torchvision import datasets
from torchvision.transforms import functional as trans_fn
import numpy as np
def resize_and_convert(img, size, resample, quality=100):
... | true | true |
1c3431e073f430407c8ba92511837ef293c7f6b3 | 1,097 | py | Python | utils/politeness.py | petarGitNik/reddit-image-downloader | e38ddaf225a47d85a0d91785eb22b80c42e886dc | [
"MIT"
] | 3 | 2019-03-29T22:09:13.000Z | 2019-05-24T07:58:52.000Z | utils/politeness.py | petarGitNik/reddit-image-downloader | e38ddaf225a47d85a0d91785eb22b80c42e886dc | [
"MIT"
] | null | null | null | utils/politeness.py | petarGitNik/reddit-image-downloader | e38ddaf225a47d85a0d91785eb22b80c42e886dc | [
"MIT"
] | 1 | 2020-07-13T14:56:14.000Z | 2020-07-13T14:56:14.000Z | #!/usr/bin/python3
from math import log
from math import exp
from domainparsers.common import Domains
def get_politeness_factor(domain):
"""
Return politeness factor for reddit.com domain. Calculated according
to instructions given here:
https://stackoverflow.com/questions/8236046/typical-politenes... | 31.342857 | 134 | 0.692799 |
from math import log
from math import exp
from domainparsers.common import Domains
def get_politeness_factor(domain):
if not domain or domain not in Domains.domains():
domain = 'other'
DOMAIN_AUTHORITY = {
Domains.REDDIT : 99,
Domains.IMGUR : 93,
Domains.GFYCAT : 70,
... | true | true |
1c343246da538f3a1d8854fff17357ff6666fcc3 | 7,733 | py | Python | tests/test_planner.py | tylernorth/public-transit | e2430078557adf9d2ad03d794ea551a7b06ce145 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_planner.py | tylernorth/public-transit | e2430078557adf9d2ad03d794ea551a7b06ce145 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_planner.py | tylernorth/public-transit | e2430078557adf9d2ad03d794ea551a7b06ce145 | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2017-03-17T11:54:09.000Z | 2022-01-21T05:07:16.000Z | from trip_planner.client import TripPlanner
MOCK_BART_STATION_LIST = {
'stations': {
'station': [
{
"name": "West Oakland",
"abbr": "WOAK",
"gtfs_latitude": "37.804872",
"gtfs_longitude": "-122.295140",
"address": "... | 33.916667 | 116 | 0.428812 | from trip_planner.client import TripPlanner
MOCK_BART_STATION_LIST = {
'stations': {
'station': [
{
"name": "West Oakland",
"abbr": "WOAK",
"gtfs_latitude": "37.804872",
"gtfs_longitude": "-122.295140",
"address": "... | true | true |
1c34327b9840461dfff1bdc4c54eb17e155d6d86 | 3,618 | py | Python | darrow/settings.py | grrdsoto/darrow | cdf818bbea9d2eb715f8834a93ca91c8dff72872 | [
"MIT"
] | null | null | null | darrow/settings.py | grrdsoto/darrow | cdf818bbea9d2eb715f8834a93ca91c8dff72872 | [
"MIT"
] | 6 | 2020-06-05T19:57:14.000Z | 2021-09-22T18:04:37.000Z | darrow/settings.py | grrdsoto/darrow | cdf818bbea9d2eb715f8834a93ca91c8dff72872 | [
"MIT"
] | null | null | null | """
Django settings for darrow project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# ... | 26.217391 | 91 | 0.691266 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.environ.get('SECRET_KEY')
DEBUG = True
ALLOWED_HOSTS = ['darrow-gstr410.herokuapp.com', '127.0.0.1', 'localhost']
# Application definition
INSTALLED_APPS = [
'chat',
'channels',
'django.contrib.admin',
... | true | true |
1c34339b65ab717b297a70f6ed3dbebf86844de9 | 2,838 | py | Python | setup.py | vsajip/sarge | 6200d310b2a0173026554cd2a9a48fa9374985c5 | [
"BSD-3-Clause"
] | 35 | 2015-03-09T20:41:02.000Z | 2022-03-12T10:29:06.000Z | setup.py | vsajip/sarge | 6200d310b2a0173026554cd2a9a48fa9374985c5 | [
"BSD-3-Clause"
] | 7 | 2019-10-23T12:34:37.000Z | 2022-01-14T18:52:36.000Z | setup.py | vsajip/sarge | 6200d310b2a0173026554cd2a9a48fa9374985c5 | [
"BSD-3-Clause"
] | 5 | 2015-11-07T17:20:39.000Z | 2021-10-03T19:31:16.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2021 Vinay M. Sajip. See LICENSE for licensing information.
#
# sarge: Subprocess Allegedly Rewards Good Encapsulation :-)
#
from distutils.core import setup, Command
import os
from os.path import join, dirname, abspath
import re
import sarge
class TestCommand(Command):... | 32.62069 | 80 | 0.617689 | from distutils.core import setup, Command
import os
from os.path import join, dirname, abspath
import re
import sarge
class TestCommand(Command):
user_options = []
def run(self):
import sys
import unittest
import test_sarge
loader = unittest.TestLoader()
runner = uni... | true | true |
1c3433b0433f82f09778b10d863693ac5a55692c | 2,193 | py | Python | filync/filync.py | xsyu94/fiLync | 96c20624371cd04d3922eda6d14eedfca9a59ab1 | [
"MIT"
] | null | null | null | filync/filync.py | xsyu94/fiLync | 96c20624371cd04d3922eda6d14eedfca9a59ab1 | [
"MIT"
] | null | null | null | filync/filync.py | xsyu94/fiLync | 96c20624371cd04d3922eda6d14eedfca9a59ab1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
main class of the filync
Author: Xiansheng Yu
Data : 2021.05.18
'''
import os
import shutil
import filync.tools as tools
class filync:
def __init__(self,
source_path='./',
goal_path='./',
ignores=['.git', '.vscode']) -> None:
... | 31.328571 | 76 | 0.561332 | import os
import shutil
import filync.tools as tools
class filync:
def __init__(self,
source_path='./',
goal_path='./',
ignores=['.git', '.vscode']) -> None:
self.source_path = source_path
self.goal_path = goal_path
if (self.source_path[-1... | true | true |
1c3434c8d5a9453f4f0be8b719dbb00378a8eb7b | 16,392 | py | Python | common/battor/battor/battor_wrapper.py | pavelfeldman/catapult | a62e07f8660650e000a8112c50bcb67258a201f2 | [
"BSD-3-Clause"
] | 1 | 2021-03-16T14:33:43.000Z | 2021-03-16T14:33:43.000Z | common/battor/battor/battor_wrapper.py | hikecoder/catapult | a62e07f8660650e000a8112c50bcb67258a201f2 | [
"BSD-3-Clause"
] | null | null | null | common/battor/battor/battor_wrapper.py | hikecoder/catapult | a62e07f8660650e000a8112c50bcb67258a201f2 | [
"BSD-3-Clause"
] | 1 | 2021-03-14T23:44:40.000Z | 2021-03-14T23:44:40.000Z | # Copyright 2016 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 atexit
import datetime
import os
import logging
import platform
import random
import subprocess
import sys
import tempfile
import time
from battor im... | 38.032483 | 80 | 0.693204 |
import atexit
import datetime
import os
import logging
import platform
import random
import subprocess
import sys
import tempfile
import time
from battor import battor_error
import py_utils
from py_utils import cloud_storage
import dependency_manager
from devil.utils import battor_device_mapping
from devil.utils impo... | true | true |
1c3435a6cc855240de2c2d26e2b0ce4f8df5479a | 4,287 | py | Python | tests/python/relay/test_name_transforms.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/relay/test_name_transforms.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | tests/python/relay/test_name_transforms.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09: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 use... | 37.278261 | 99 | 0.70982 |
from tvm import TVMError
from tvm.relay.backend.name_transforms import (
to_c_function_style,
to_c_variable_style,
to_c_constant_style,
prefix_name,
prefix_generated_name,
sanitize_name,
)
import pytest
def test_to_c_function_style():
assert to_c_function_style("TVM_Woof") == "TVMWoof"
... | true | true |
1c34364153b35a31a3417fb55f88b56115287023 | 1,111 | py | Python | datalad/support/cache.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | null | null | null | datalad/support/cache.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | 6 | 2015-11-20T21:41:13.000Z | 2018-06-12T14:27:32.000Z | datalad/support/cache.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | 1 | 2017-03-28T14:44:16.000Z | 2017-03-28T14:44:16.000Z | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | 34.71875 | 87 | 0.572457 |
from collections import OrderedDict
class DictCache(OrderedDict):
def __init__(self, *args, **kwds):
self.size_limit = kwds.pop("size_limit", None)
OrderedDict.__init__(self, *args, **kwds)
self._check_size_limit()
def __setitem__(self, key, value):
OrderedDict.__setitem__(se... | true | true |
1c3436a93e156c9b163508894959b51b9b7b4eb6 | 1,427 | py | Python | pandashells/bin/p_linspace.py | timgates42/pandashells | 4b565435a25ac713eeeacf28c3e5b52fe94530d8 | [
"BSD-2-Clause-FreeBSD"
] | 878 | 2015-08-02T02:07:20.000Z | 2022-01-15T19:06:47.000Z | pandashells/bin/p_linspace.py | timgates42/pandashells | 4b565435a25ac713eeeacf28c3e5b52fe94530d8 | [
"BSD-2-Clause-FreeBSD"
] | 44 | 2015-05-12T15:56:57.000Z | 2021-01-13T20:58:29.000Z | pandashells/bin/p_linspace.py | timgates42/pandashells | 4b565435a25ac713eeeacf28c3e5b52fe94530d8 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2015-08-02T22:48:36.000Z | 2021-01-13T20:54:58.000Z | #! /usr/bin/env python
# standard library imports
import sys # NOQA import sys to allow for mocking sys.argv in tests
import argparse
import textwrap
from pandashells.lib import module_checker_lib, arg_lib
module_checker_lib.check_for_modules(['pandas'])
from pandashells.lib import io_lib
import numpy as np
impor... | 25.945455 | 79 | 0.597758 |
import sys import argparse
import textwrap
from pandashells.lib import module_checker_lib, arg_lib
module_checker_lib.check_for_modules(['pandas'])
from pandashells.lib import io_lib
import numpy as np
import pandas as pd
def main():
msg = "Generate a linearly spaced set of data points."
msg = textwrap.... | true | true |
1c3438005bf0a2213fed7f01d5fce16c91644252 | 8,117 | py | Python | FlyTrackApp/flight_tracker_vis_class.py | jmmelis/FlyTrackApp | 7c03eb0aeda7b0bd4e0c6181bc776c92e4fbc582 | [
"MIT"
] | null | null | null | FlyTrackApp/flight_tracker_vis_class.py | jmmelis/FlyTrackApp | 7c03eb0aeda7b0bd4e0c6181bc776c92e4fbc582 | [
"MIT"
] | null | null | null | FlyTrackApp/flight_tracker_vis_class.py | jmmelis/FlyTrackApp | 7c03eb0aeda7b0bd4e0c6181bc776c92e4fbc582 | [
"MIT"
] | null | null | null | import vtk
import sys
import os
import time
import numpy as np
# flight tracker visualization class
class FlightTrackerVisualization:
def __init__(self):
# window parameters
self.window_name = "Model"
self.background = (0.1,0.2,0.4)
self.window_sz = (600, 600)
# stl model parameters
self.model_name = ... | 30.287313 | 90 | 0.724036 | import vtk
import sys
import os
import time
import numpy as np
class FlightTrackerVisualization:
def __init__(self):
self.window_name = "Model"
self.background = (0.1,0.2,0.4)
self.window_sz = (600, 600)
self.model_name = ""
self.stl_list = []
self.model_loc = ""
self.stl_src = []
self.stl_act... | true | true |
1c3438bcf49ef281259083f830ab90e75458a3b3 | 470 | py | Python | cirq-google/cirq_google/workflow/__init__.py | unaiic/Cirq | d137a7d69fb6e0f2afb676b179ffdf7a198363f5 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/workflow/__init__.py | unaiic/Cirq | d137a7d69fb6e0f2afb676b179ffdf7a198363f5 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/workflow/__init__.py | unaiic/Cirq | d137a7d69fb6e0f2afb676b179ffdf7a198363f5 | [
"Apache-2.0"
] | 2 | 2021-09-22T11:16:46.000Z | 2021-09-23T12:55:22.000Z | # pylint: disable=wrong-or-nonexistent-copyright-notice
from cirq_google.workflow.quantum_executable import (
ExecutableSpec,
KeyValueExecutableSpec,
QuantumExecutable,
QuantumExecutableGroup,
BitstringsMeasurement,
)
from cirq_google.workflow.quantum_runtime import (
SharedRuntimeInfo,
Run... | 24.736842 | 55 | 0.785106 | from cirq_google.workflow.quantum_executable import (
ExecutableSpec,
KeyValueExecutableSpec,
QuantumExecutable,
QuantumExecutableGroup,
BitstringsMeasurement,
)
from cirq_google.workflow.quantum_runtime import (
SharedRuntimeInfo,
RuntimeInfo,
ExecutableResult,
ExecutableGroupResul... | true | true |
1c34390d2bcd7b5fa6794c8b84106f4ee13a2ac5 | 6,917 | py | Python | autocomplete_light/tests/widgets.py | bburan/django-autocomplete-light | 064676061b101d5d47655e8598b21cbaf7716ae8 | [
"MIT"
] | 1 | 2015-07-01T02:26:51.000Z | 2015-07-01T02:26:51.000Z | autocomplete_light/tests/widgets.py | bburan/django-autocomplete-light | 064676061b101d5d47655e8598b21cbaf7716ae8 | [
"MIT"
] | null | null | null | autocomplete_light/tests/widgets.py | bburan/django-autocomplete-light | 064676061b101d5d47655e8598b21cbaf7716ae8 | [
"MIT"
] | null | null | null | from lxml.html import etree
from lxml.cssselect import CSSSelector
try:
from unittest import mock
except ImportError: # python2
import mock
from django.test import TestCase
import autocomplete_light
from ..example_apps.basic.models import FkModel
from ..example_apps.security_test.models import Item
class... | 35.111675 | 81 | 0.656354 | from lxml.html import etree
from lxml.cssselect import CSSSelector
try:
from unittest import mock
except ImportError: import mock
from django.test import TestCase
import autocomplete_light
from ..example_apps.basic.models import FkModel
from ..example_apps.security_test.models import Item
class LazyAutoc... | true | true |
1c34391518004496e38d5b8a753fef4334f1ebab | 3,187 | py | Python | plato/processors/registry.py | NingxinSu/plato | 94c1c0d7d8b1a1b0ff7f6d9efcf1883f314d9668 | [
"Apache-2.0"
] | null | null | null | plato/processors/registry.py | NingxinSu/plato | 94c1c0d7d8b1a1b0ff7f6d9efcf1883f314d9668 | [
"Apache-2.0"
] | null | null | null | plato/processors/registry.py | NingxinSu/plato | 94c1c0d7d8b1a1b0ff7f6d9efcf1883f314d9668 | [
"Apache-2.0"
] | null | null | null | """
This registry for Processors contains framework-specific implementations of
Processors for data payloads.
Having a registry of all available classes is convenient for retrieving an instance
based on a configuration at run-time.
"""
import logging
from collections import OrderedDict
from typing import Tuple
from p... | 34.641304 | 83 | 0.688422 | import logging
from collections import OrderedDict
from typing import Tuple
from plato.config import Config
from plato.processors import pipeline
if not (hasattr(Config().trainer, 'use_tensorflow')
or hasattr(Config().trainer, 'use_mindspore')):
from plato.processors import (
base,
feature... | true | true |
1c343b29fd70682caa31e6d22ef7e8dbd0c921c6 | 9,125 | py | Python | mcse/crystals/packing_factor.py | manny405/mcse | 419e4b8c144563ae0bf48982fc7ea26ce941a3eb | [
"Apache-2.0"
] | 5 | 2021-07-22T17:24:58.000Z | 2021-11-30T07:50:29.000Z | mcse/crystals/packing_factor.py | manny405/mcse | 419e4b8c144563ae0bf48982fc7ea26ce941a3eb | [
"Apache-2.0"
] | null | null | null | mcse/crystals/packing_factor.py | manny405/mcse | 419e4b8c144563ae0bf48982fc7ea26ce941a3eb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from scipy.spatial.distance import cdist
from scipy.spatial import cKDTree
from ase.data import vdw_radii,atomic_numbers,covalent_radii
from ase.data.vdw_alvarez import vdw_radii as vdw_radii_alvarez
from mcse import Structure
from mcse import BaseDriver_
from mcse.crystal... | 36.067194 | 80 | 0.575342 |
import numpy as np
from scipy.spatial.distance import cdist
from scipy.spatial import cKDTree
from ase.data import vdw_radii,atomic_numbers,covalent_radii
from ase.data.vdw_alvarez import vdw_radii as vdw_radii_alvarez
from mcse import Structure
from mcse import BaseDriver_
from mcse.crystals.supercell import Super... | true | true |
1c343b4f04b36da4721ba9a17023c8fdf11baf55 | 306 | py | Python | sndg/users/apps.py | ezequieljsosa/sndg-web | 7763c8fbc83dc92abb9c53326e2fe227bcabf607 | [
"MIT"
] | null | null | null | sndg/users/apps.py | ezequieljsosa/sndg-web | 7763c8fbc83dc92abb9c53326e2fe227bcabf607 | [
"MIT"
] | null | null | null | sndg/users/apps.py | ezequieljsosa/sndg-web | 7763c8fbc83dc92abb9c53326e2fe227bcabf607 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class UsersConfig(AppConfig):
name = "sndg.users"
verbose_name = _("Users")
def ready(self):
try:
import sndg.users.signals # noqa F401
except ImportError:
pass
| 21.857143 | 54 | 0.647059 | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class UsersConfig(AppConfig):
name = "sndg.users"
verbose_name = _("Users")
def ready(self):
try:
import sndg.users.signals except ImportError:
pass
| true | true |
1c343ba8a0535159ec3ae4576051ac4bf144647f | 263 | py | Python | geminidr/niri/recipes/ql/recipes_FLAT_IMAGE.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 19 | 2017-10-23T14:52:51.000Z | 2022-03-28T04:49:00.000Z | geminidr/niri/recipes/ql/recipes_FLAT_IMAGE.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 194 | 2017-11-01T17:32:45.000Z | 2022-03-31T21:32:59.000Z | geminidr/niri/recipes/ql/recipes_FLAT_IMAGE.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 16 | 2017-11-01T05:18:04.000Z | 2021-12-14T23:08:57.000Z | """
Recipes available to data with tags ['NIRI', 'CAL', 'IMAGE', 'FLAT'].
Default is "makeProcessedFlat".
"""
recipe_tags = {'NIRI', 'CAL', 'IMAGE', 'FLAT'}
from geminidr.niri.recipes.sq.recipes_FLAT_IMAGE import makeProcessedFlat
_default = makeProcessedFlat
| 23.909091 | 73 | 0.722433 | recipe_tags = {'NIRI', 'CAL', 'IMAGE', 'FLAT'}
from geminidr.niri.recipes.sq.recipes_FLAT_IMAGE import makeProcessedFlat
_default = makeProcessedFlat
| true | true |
1c343bc3d230830ecaf1ae3297bee7e19a1e30f8 | 3,258 | py | Python | examples/demo3.py | Freakwill/skinner | bcb036fc753addcd09655b7a775dbcdb1f99f1f6 | [
"MIT"
] | null | null | null | examples/demo3.py | Freakwill/skinner | bcb036fc753addcd09655b7a775dbcdb1f99f1f6 | [
"MIT"
] | null | null | null | examples/demo3.py | Freakwill/skinner | bcb036fc753addcd09655b7a775dbcdb1f99f1f6 | [
"MIT"
] | 2 | 2020-09-28T06:09:45.000Z | 2021-01-17T04:16:40.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gym
gym.register(
id='GridWorld-v1',
entry_point='simple_grid:MyGridWorld3',
max_episode_steps=200,
reward_threshold=1000
)
from objects import Robot, NeuralRobot
class MyRobot(Robot):
init_power = 25
@property
def flag1(self):... | 25.653543 | 103 | 0.503376 |
import gym
gym.register(
id='GridWorld-v1',
entry_point='simple_grid:MyGridWorld3',
max_episode_steps=200,
reward_threshold=1000
)
from objects import Robot, NeuralRobot
class MyRobot(Robot):
init_power = 25
@property
def flag1(self):
return self.state[2]
@property
... | true | true |
1c343cb4a2aa73ac773b7d30298cff3da21bcd2e | 1,392 | py | Python | resources/errors.py | weis999/btfwest01 | faba7c53c1ff6e0eb3ffd36f33df39ab490ec2f6 | [
"MIT"
] | null | null | null | resources/errors.py | weis999/btfwest01 | faba7c53c1ff6e0eb3ffd36f33df39ab490ec2f6 | [
"MIT"
] | null | null | null | resources/errors.py | weis999/btfwest01 | faba7c53c1ff6e0eb3ffd36f33df39ab490ec2f6 | [
"MIT"
] | null | null | null | class InternalServerError(Exception):
pass
class SchemaValidationError(Exception):
pass
class FieldAlreadyExistsError(Exception):
pass
class UpdatingFieldError(Exception):
pass
class DeletingFieldError(Exception):
pass
class FieldNotExistsError(Exception):
pass
class EmailAlreadyExistsErro... | 24 | 81 | 0.619253 | class InternalServerError(Exception):
pass
class SchemaValidationError(Exception):
pass
class FieldAlreadyExistsError(Exception):
pass
class UpdatingFieldError(Exception):
pass
class DeletingFieldError(Exception):
pass
class FieldNotExistsError(Exception):
pass
class EmailAlreadyExistsErro... | true | true |
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="certif... | true | 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 = None... | 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 == -length: # c... | 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.systems ... | 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=Fa... | 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']
c... | 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'
# The full version, including al... | 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.IncrementalEncoder... | 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 |
if "bpy" in locals():
import importlib
if "parse_fbx" in locals():
importlib.reload(parse_fbx)
if "fbx_utils" in locals():
importlib.reload(fbx_utils)
import bpy
from mathutils import Matrix, Euler, Vector
from . import parse_fbx, fbx_utils
from .parse_fbx import (
data_types,
... | 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 su... | 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("mem... | 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
class Analysis(DataAnalysis):
def __init__(self, *args, **kwargs):
... | 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_initial... | 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
from databricks.ko... | 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')
selected_dat... | 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_info for c in cells], [... | 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 model as network_... | 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()
renWin = v... | 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 ip ... | 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
class Activation(Token):
def __init__(self, config, token=None, username=None):
self.config = config
self.type = self.config.db.ActivationCode
super().__... | 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.device.... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.