hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2855ebd393014f3c334062d4d65d9a12bb294f | 1,726 | py | Python | h2o-py/tests/testdir_algos/glm/pyunit_pubdev_6037_fractionalbinomial_pojo_mojo.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_algos/glm/pyunit_pubdev_6037_fractionalbinomial_pojo_mojo.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_algos/glm/pyunit_pubdev_6037_fractionalbinomial_pojo_mojo.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | import sys, os
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
import tempfile
def glm_fractional_binomial_mojo_pojo():
params = set_params()
train = h2o.import_file(pyunit_utils.locate("smalldata/glm_test/fraction_binommialOrig.csv"))
test = h2o.import_file(pyunit_utils.locate("... | 46.648649 | 223 | 0.73175 | import sys, os
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
import tempfile
def glm_fractional_binomial_mojo_pojo():
params = set_params()
train = h2o.import_file(pyunit_utils.locate("smalldata/glm_test/fraction_binommialOrig.csv"))
test = h2o.import_file(pyunit_utils.locate("... | true | true |
1c285615e3ba59148b4c36eb8a522921f7389c6f | 1,306 | py | Python | conditions/if_condition.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | 2 | 2020-11-02T05:52:33.000Z | 2021-06-09T01:28:22.000Z | conditions/if_condition.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | null | null | null | conditions/if_condition.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | 2 | 2021-04-08T05:26:04.000Z | 2021-06-09T01:28:23.000Z | cars = ['audi', 'bmw', 'toyota', 'subaru']
for car in cars:
if car == "bmw":
print(car.upper())
else:
print(car.title())
requested_topping = "mushrooms"
if requested_topping != "tomatoes":
print("Wait for tomatoes later!")
lower_limit = 18
upper_limit = 30
age_0 = 35
age_1 = 25
contestants... | 26.12 | 78 | 0.659265 | cars = ['audi', 'bmw', 'toyota', 'subaru']
for car in cars:
if car == "bmw":
print(car.upper())
else:
print(car.title())
requested_topping = "mushrooms"
if requested_topping != "tomatoes":
print("Wait for tomatoes later!")
lower_limit = 18
upper_limit = 30
age_0 = 35
age_1 = 25
contestants... | true | true |
1c28574c19f66be232e810c0da94c6db5938a596 | 25,473 | py | Python | testproject/testapp/tests.py | bogdandm/django_sphinxsearch | b3a4a46997b4648413cc0313f409c4bdf2c0ebe9 | [
"Beerware"
] | null | null | null | testproject/testapp/tests.py | bogdandm/django_sphinxsearch | b3a4a46997b4648413cc0313f409c4bdf2c0ebe9 | [
"Beerware"
] | null | null | null | testproject/testapp/tests.py | bogdandm/django_sphinxsearch | b3a4a46997b4648413cc0313f409c4bdf2c0ebe9 | [
"Beerware"
] | null | null | null | import sys
from datetime import timedelta
import pytz
import re
from django.conf import settings
from django.db import connections
from django.db.models import Sum, Q
from django.db.utils import ProgrammingError
from django.test import TransactionTestCase, utils
from django.utils import timezone
from sphinxsearch.rou... | 36.39 | 79 | 0.599655 | import sys
from datetime import timedelta
import pytz
import re
from django.conf import settings
from django.db import connections
from django.db.models import Sum, Q
from django.db.utils import ProgrammingError
from django.test import TransactionTestCase, utils
from django.utils import timezone
from sphinxsearch.rou... | true | true |
1c28576b88793e29d83b92db274f9684e60ee6ac | 3,265 | py | Python | tools/swa.py | JoelPendleton/QDot-Detector | e53b80c02fe95ceacd3dde9981dcd0481b907bdc | [
"Apache-2.0"
] | null | null | null | tools/swa.py | JoelPendleton/QDot-Detector | e53b80c02fe95ceacd3dde9981dcd0481b907bdc | [
"Apache-2.0"
] | null | null | null | tools/swa.py | JoelPendleton/QDot-Detector | e53b80c02fe95ceacd3dde9981dcd0481b907bdc | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.python import pywrap_tensorflow
import numpy as np
import sys
import os
sys.path.append('../')
from libs.co... | 34.734043 | 122 | 0.633691 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.python import pywrap_tensorflow
import numpy as np
import sys
import os
sys.path.append('../')
from libs.configs import cfgs
cl... | true | true |
1c2858f501f5b72e8fe717b2fa99c1da193c80a1 | 4,311 | py | Python | cms/form.py | fossabot/gophr | 3ff69cdb352e871aa61c23cb277d721459de6f41 | [
"MIT"
] | null | null | null | cms/form.py | fossabot/gophr | 3ff69cdb352e871aa61c23cb277d721459de6f41 | [
"MIT"
] | null | null | null | cms/form.py | fossabot/gophr | 3ff69cdb352e871aa61c23cb277d721459de6f41 | [
"MIT"
] | null | null | null | import json
from collections import OrderedDict
from django.db import models
from django import forms
from cms.models import Component, ComponentType, Section
OBJ_TYPE_TO_FIELD_LOOKUP = {
'string': {
'field': models.CharField,
},
'number': {
'field': models.FloatField
},
'bool': {
... | 30.792857 | 112 | 0.602876 | import json
from collections import OrderedDict
from django.db import models
from django import forms
from cms.models import Component, ComponentType, Section
OBJ_TYPE_TO_FIELD_LOOKUP = {
'string': {
'field': models.CharField,
},
'number': {
'field': models.FloatField
},
'bool': {
... | true | true |
1c285928f3ba366f6726e797406628c98a89dcf2 | 22,671 | py | Python | code/lstm.py | ystoto/shelter_ml | a961a6cd6c8771a3a8ee8e807bbe61c5c42ef857 | [
"BSD-3-Clause"
] | 42 | 2015-04-17T08:33:54.000Z | 2021-05-24T08:49:51.000Z | code/lstm.py | ystoto/shelter_ml | a961a6cd6c8771a3a8ee8e807bbe61c5c42ef857 | [
"BSD-3-Clause"
] | null | null | null | code/lstm.py | ystoto/shelter_ml | a961a6cd6c8771a3a8ee8e807bbe61c5c42ef857 | [
"BSD-3-Clause"
] | 20 | 2015-03-15T19:11:47.000Z | 2020-07-22T13:37:16.000Z | '''
Build a tweet sentiment analyzer
'''
from __future__ import print_function
import six.moves.cPickle as pickle
from collections import OrderedDict
import sys
import time
import numpy
import theano
from theano import config
import theano.tensor as tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams as Rand... | 34.454407 | 154 | 0.555688 |
from __future__ import print_function
import six.moves.cPickle as pickle
from collections import OrderedDict
import sys
import time
import numpy
import theano
from theano import config
import theano.tensor as tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import imdb
datasets = {'imdb... | true | true |
1c2859bcd74b3d93917dc784f9fe6dae2e49b458 | 45,114 | py | Python | core_contracts/governance/governance.py | AntonAndell/balanced-contracts | 1444e2eed95087e3b48777832b8de2ca26dfbdfe | [
"MIT"
] | null | null | null | core_contracts/governance/governance.py | AntonAndell/balanced-contracts | 1444e2eed95087e3b48777832b8de2ca26dfbdfe | [
"MIT"
] | null | null | null | core_contracts/governance/governance.py | AntonAndell/balanced-contracts | 1444e2eed95087e3b48777832b8de2ca26dfbdfe | [
"MIT"
] | null | null | null | # Copyright 2021 Balanced DAO
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 42.044734 | 121 | 0.654697 |
from .data_objects import *
from .utils.checks import *
TAG = 'Governance'
class Governance(IconScoreBase):
def __init__(self, db: IconScoreDatabase) -> None:
super().__init__(db)
self.addresses = Addresses(db, self)
self.vote_execute = VoteActions(db, self)
self._l... | true | true |
1c285a9005fa4ae5e2ed6e4db2706b01f6592187 | 600 | py | Python | sys/debug/ktrace.py | pj1031999/mimiker | ed701132b45dbb6b3b94121cd1ef3820bf4781aa | [
"BSD-3-Clause"
] | 185 | 2016-06-24T16:40:13.000Z | 2022-03-24T18:07:18.000Z | sys/debug/ktrace.py | pj1031999/mimiker | ed701132b45dbb6b3b94121cd1ef3820bf4781aa | [
"BSD-3-Clause"
] | 586 | 2016-04-21T22:54:18.000Z | 2022-03-25T18:34:01.000Z | sys/debug/ktrace.py | pj1031999/mimiker | ed701132b45dbb6b3b94121cd1ef3820bf4781aa | [
"BSD-3-Clause"
] | 57 | 2016-06-03T14:02:11.000Z | 2022-03-12T03:18:54.000Z | from .thread import ThreadCreateBP, ThreadSwitchBP
from .cmd import CommandDispatcher, TraceCommand
class ThreadCreateTrace(TraceCommand):
"""Trace thread create events"""
def __init__(self):
super().__init__('thread_create', ThreadCreateBP)
class ThreadSwitchTrace(TraceCommand):
"""Trace thread... | 27.272727 | 78 | 0.72 | from .thread import ThreadCreateBP, ThreadSwitchBP
from .cmd import CommandDispatcher, TraceCommand
class ThreadCreateTrace(TraceCommand):
def __init__(self):
super().__init__('thread_create', ThreadCreateBP)
class ThreadSwitchTrace(TraceCommand):
def __init__(self):
super().__init__('thread... | true | true |
1c285b2cc0d20cd1cd562b228568e57491468eac | 1,443 | py | Python | utils.py | Snusmumr1000/cara-sample-module | a8d6a83b4472d27ea0d3dc4b2fedc1fb8f8929c1 | [
"MIT"
] | null | null | null | utils.py | Snusmumr1000/cara-sample-module | a8d6a83b4472d27ea0d3dc4b2fedc1fb8f8929c1 | [
"MIT"
] | null | null | null | utils.py | Snusmumr1000/cara-sample-module | a8d6a83b4472d27ea0d3dc4b2fedc1fb8f8929c1 | [
"MIT"
] | null | null | null | import json
import importlib
from pathlib import Path
from caracal.execution import Node
def generate_declarations_in_module_from_implementations(module_directory=".", namespace=None):
module_directory = Path(module_directory)
cfg = json.load(open("cara.json")) # GET repository/cara.json
module_name, nod... | 37 | 104 | 0.738739 | import json
import importlib
from pathlib import Path
from caracal.execution import Node
def generate_declarations_in_module_from_implementations(module_directory=".", namespace=None):
module_directory = Path(module_directory)
cfg = json.load(open("cara.json"))
module_name, node_names = cfg["module_name... | true | true |
1c285c28e3474d8f1d49a5bd2b9a70a38eea62fb | 671 | py | Python | podcasts/migrations/0002_auto_20200705_1958.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | podcasts/migrations/0002_auto_20200705_1958.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | podcasts/migrations/0002_auto_20200705_1958.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | 1 | 2020-07-03T21:04:34.000Z | 2020-07-03T21:04:34.000Z | # Generated by Django 3.0.8 on 2020-07-05 22:58
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('podcasts', '0001_initial'),
]
operations = [
migrations.AddField(
model_na... | 25.807692 | 110 | 0.609538 |
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('podcasts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='podcast',
name='excerto',
... | true | true |
1c285c59aafd2cfdf1fc57993b14e30f92f927a0 | 801 | py | Python | gaphas/painter/painter.py | AhmedMounir/gaphas | a51f0171796199332da8187411ae2d70dc883e2e | [
"Apache-2.0"
] | 1 | 2021-12-17T18:03:15.000Z | 2021-12-17T18:03:15.000Z | gaphas/painter/painter.py | AhmedMounir/gaphas | a51f0171796199332da8187411ae2d70dc883e2e | [
"Apache-2.0"
] | null | null | null | gaphas/painter/painter.py | AhmedMounir/gaphas | a51f0171796199332da8187411ae2d70dc883e2e | [
"Apache-2.0"
] | null | null | null | """The painter module provides different painters for parts of the canvas.
Painters can be swapped in and out.
Each painter takes care of a layer in the canvas (such as grid, items
and handles).
"""
from typing import Collection, Protocol
from cairo import Context as CairoContext
from gaphas.item import Item
cla... | 25.83871 | 74 | 0.685393 |
from typing import Collection, Protocol
from cairo import Context as CairoContext
from gaphas.item import Item
class Painter(Protocol):
def paint(self, items: Collection[Item], cairo: CairoContext) -> None:
pass
class ItemPainterType(Protocol):
def paint_item(self, item: Item, cairo: CairoContex... | true | true |
1c285c63b0e425735f50b2fbbcfe55a32b02dd05 | 51,777 | py | Python | Assoc/annotator.py | jianTaoLiu-SWJTU2012/taolib | 6c3d6bdbfc8d6038ce4835f6e149c0f3dba8ca4d | [
"BSD-3-Clause"
] | 14 | 2015-12-25T14:20:25.000Z | 2022-01-01T07:31:56.000Z | Assoc/annotator.py | jianTaoLiu-SWJTU2012/taolib | 6c3d6bdbfc8d6038ce4835f6e149c0f3dba8ca4d | [
"BSD-3-Clause"
] | null | null | null | Assoc/annotator.py | jianTaoLiu-SWJTU2012/taolib | 6c3d6bdbfc8d6038ce4835f6e149c0f3dba8ca4d | [
"BSD-3-Clause"
] | 11 | 2016-11-06T06:27:10.000Z | 2021-06-16T16:11:01.000Z |
"""Module Description
Copyright (c) 2008 H. Gene Shin <shin@jimmy.harvard.edu>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: experimental
@version: $Revision$
@author: H. Gene Shin
@contact: s... | 43.916031 | 223 | 0.557526 |
import sys,time,re,operator,copy,sqlite3,warnings
import itertools
from array import *
import bisect
from Cistrome.Assoc.inout import *
from Cistrome.Assoc.tables import *
from Cistrome.Assoc.sampler import *
from Cistrome.Assoc.corelib import *
from Cistrome.CoreLib.BasicStat import *
class Annotator:
... | true | true |
1c285c644645bded97a5d762cd9d1de80f332262 | 664 | py | Python | structure/priority_quene.py | fujihiraryo/library | cdb01e710219d7111f890d09f89531916dd03533 | [
"MIT"
] | null | null | null | structure/priority_quene.py | fujihiraryo/library | cdb01e710219d7111f890d09f89531916dd03533 | [
"MIT"
] | 4 | 2020-12-16T10:00:00.000Z | 2021-02-12T12:51:50.000Z | structure/priority_quene.py | fujihiraryo/python-kyopro-library | cdb01e710219d7111f890d09f89531916dd03533 | [
"MIT"
] | null | null | null | import heapq
from collections import defaultdict
class PriorityQuene:
def __init__(self):
self.heap = []
self.count = defaultdict(int)
def push(self, x):
heapq.heappush(self.heap, x)
self.count[x] += 1
def pop(self):
res = self.top()
self.remove(res)
... | 20.121212 | 38 | 0.53012 | import heapq
from collections import defaultdict
class PriorityQuene:
def __init__(self):
self.heap = []
self.count = defaultdict(int)
def push(self, x):
heapq.heappush(self.heap, x)
self.count[x] += 1
def pop(self):
res = self.top()
self.remove(res)
... | true | true |
1c285cb123a7ce3c58a19bb07d6ecfe7a72e9dd0 | 324 | py | Python | tests/urls.py | softformance/django-social-photostream | 0e9e4a2aca906961b1a75d82fbac998febcfad9a | [
"MIT"
] | null | null | null | tests/urls.py | softformance/django-social-photostream | 0e9e4a2aca906961b1a75d82fbac998febcfad9a | [
"MIT"
] | null | null | null | tests/urls.py | softformance/django-social-photostream | 0e9e4a2aca906961b1a75d82fbac998febcfad9a | [
"MIT"
] | null | null | null | # -*- coding: utf-8
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from django_social_photostream.urls import urlpatterns as django_social_photostream_urls
urlpatterns = [
url(r'^', include(django_social_photostream_urls, namespace='django_social_photostream'))... | 29.454545 | 94 | 0.811728 |
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from django_social_photostream.urls import urlpatterns as django_social_photostream_urls
urlpatterns = [
url(r'^', include(django_social_photostream_urls, namespace='django_social_photostream')),
]
| true | true |
1c285dbf137657d1b84e2b84900a179b96fdea7d | 2,968 | py | Python | examples/minimal/models.py | jqueguiner/haven | 7b2a5d46b08f48f1112f8903f1b97c6adadff3f4 | [
"Apache-2.0"
] | 26 | 2020-01-09T14:28:28.000Z | 2020-08-09T08:03:08.000Z | examples/minimal/models.py | jqueguiner/haven | 7b2a5d46b08f48f1112f8903f1b97c6adadff3f4 | [
"Apache-2.0"
] | null | null | null | examples/minimal/models.py | jqueguiner/haven | 7b2a5d46b08f48f1112f8903f1b97c6adadff3f4 | [
"Apache-2.0"
] | 6 | 2020-02-11T19:43:50.000Z | 2020-05-12T01:59:59.000Z | import torch
import tqdm
from torch import nn
def get_model(model_name):
if model_name == 'mlp':
return MLP()
class MLP(nn.Module):
def __init__(self, input_size=784, n_classes=10):
"""Constructor."""
super().__init__()
self.input_size = input_size
self.hidden_layers... | 28 | 81 | 0.579515 | import torch
import tqdm
from torch import nn
def get_model(model_name):
if model_name == 'mlp':
return MLP()
class MLP(nn.Module):
def __init__(self, input_size=784, n_classes=10):
super().__init__()
self.input_size = input_size
self.hidden_layers = nn.ModuleList([nn.Linear... | true | true |
1c285e501ec1f348ac9bc185f83cf8cf89827153 | 2,739 | py | Python | scripts/CursesExample.py | AgalmicVentures/Environment | b2ef280d2424a5a940af7cef0c9a6dbca62d93c4 | [
"MIT"
] | 1 | 2018-10-10T01:06:14.000Z | 2018-10-10T01:06:14.000Z | scripts/CursesExample.py | AgalmicVentures/Environment | b2ef280d2424a5a940af7cef0c9a6dbca62d93c4 | [
"MIT"
] | 1 | 2020-02-28T18:13:05.000Z | 2020-02-28T18:13:05.000Z | scripts/CursesExample.py | AgalmicVentures/Environment | b2ef280d2424a5a940af7cef0c9a6dbca62d93c4 | [
"MIT"
] | 1 | 2017-02-26T09:29:06.000Z | 2017-02-26T09:29:06.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2021 Agalmic Ventures LLC (www.agalmicventures.com)
#
# 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 limit... | 26.085714 | 81 | 0.71705 |
import curses
import sys
import time
def centerText(screen, text, row, flags=0):
c = (curses.COLS - len(text)) // 2
screen.addstr(row, c, text, flags)
return c
def cursesMain(screen):
c = centerText(screen, 'Enter Your Name', 1, curses.A_BOLD | curses.A_UNDERLINE)
name = ''
while name... | true | true |
1c285ebf82531064442be76def442ed35fbe9eaf | 1,046 | py | Python | PythonExercicios/ex042.py | github-felipe/ExerciciosEmPython-cursoemvideo | 0045464a287f21b6245554a975588cf06c5b476d | [
"MIT"
] | null | null | null | PythonExercicios/ex042.py | github-felipe/ExerciciosEmPython-cursoemvideo | 0045464a287f21b6245554a975588cf06c5b476d | [
"MIT"
] | null | null | null | PythonExercicios/ex042.py | github-felipe/ExerciciosEmPython-cursoemvideo | 0045464a287f21b6245554a975588cf06c5b476d | [
"MIT"
] | null | null | null | valores = str(input('Digite o comprimento de 3 retas separando-as por espaços: ')).strip()
n1 = float(valores.split()[0])
n2 = float(valores.split()[1])
n3 = float(valores.split()[2])
if n1 < n2 + n3 and n2 < n1 + n3 and n3 < n1 + n2:
print('Com o comprimento dessas retas é possível de se formar um triângulo!')
... | 47.545455 | 110 | 0.64914 | valores = str(input('Digite o comprimento de 3 retas separando-as por espaços: ')).strip()
n1 = float(valores.split()[0])
n2 = float(valores.split()[1])
n3 = float(valores.split()[2])
if n1 < n2 + n3 and n2 < n1 + n3 and n3 < n1 + n2:
print('Com o comprimento dessas retas é possível de se formar um triângulo!')
... | true | true |
1c285ed6d0793257cfbafe133424593761a8fd62 | 3,286 | py | Python | exampleSite/exampleSite/settings.py | marcanuy/django-staticpages | e65d29e31823cdfda186043ddf5c05a0c49cd73a | [
"MIT"
] | 1 | 2019-06-17T20:57:27.000Z | 2019-06-17T20:57:27.000Z | exampleSite/exampleSite/settings.py | marcanuy/django-mdpages | e65d29e31823cdfda186043ddf5c05a0c49cd73a | [
"MIT"
] | null | null | null | exampleSite/exampleSite/settings.py | marcanuy/django-mdpages | e65d29e31823cdfda186043ddf5c05a0c49cd73a | [
"MIT"
] | null | null | null | """
Django settings for exampleSite project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import o... | 25.874016 | 91 | 0.6972 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'ox)pg8l3ac6(+$l7w(xu$j3*^q_1w^uj%h1g^(%r799-kbl^9='
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c285ef0d6de58092a078922a7328fae2e55d79e | 422 | py | Python | example_project/news/factories.py | pancentric/django-mininews | 3e875c5c7f02eb713c5cca5da938fc50cf0d11aa | [
"MIT"
] | null | null | null | example_project/news/factories.py | pancentric/django-mininews | 3e875c5c7f02eb713c5cca5da938fc50cf0d11aa | [
"MIT"
] | null | null | null | example_project/news/factories.py | pancentric/django-mininews | 3e875c5c7f02eb713c5cca5da938fc50cf0d11aa | [
"MIT"
] | null | null | null | from django.utils.text import slugify
import factory
from .models import Article
class ArticleFactory(factory.django.DjangoModelFactory):
FACTORY_FOR = Article
# Create some dummy default values for the title (which has to be unique).
title = factory.Sequence(lambda n: 'article{0:0>3}'.format(n))
s... | 30.142857 | 78 | 0.748815 | from django.utils.text import slugify
import factory
from .models import Article
class ArticleFactory(factory.django.DjangoModelFactory):
FACTORY_FOR = Article
title = factory.Sequence(lambda n: 'article{0:0>3}'.format(n))
slug = factory.LazyAttribute(lambda a: slugify(unicode(a.title)))
statu... | true | true |
1c285f0112a1098dc138704612758fd63b9204fa | 10,819 | py | Python | bin/create_release.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 1 | 2019-12-14T15:25:38.000Z | 2019-12-14T15:25:38.000Z | bin/create_release.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 26 | 2018-10-08T15:49:32.000Z | 2020-05-15T13:33:36.000Z | bin/create_release.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 2 | 2019-03-25T17:28:48.000Z | 2021-04-21T12:15:53.000Z | #! /usr/bin/env python
################################################################################
#
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix el... | 37.828671 | 119 | 0.655051 |
emplate','NLO','SubProcesses','trapfpe.c'))
create_empty = open(path.join(filepath,'Template','NLO','SubProcesses','trapfpe.c'),'w')
create_empty.close()
# 2. Create the automatic documentation in the apidoc directory
try:
status1 = subprocess.call(['epydoc', '--html', '-o', 'apidoc',
... | false | true |
1c285f116a01ff07b067a6acd193ce4a93a5a6b6 | 21,514 | py | Python | stumpy/stimp.py | SaVoAMP/stumpy | d63963caaf6a8b64448953f638c1d3345e05a36a | [
"BSD-3-Clause"
] | null | null | null | stumpy/stimp.py | SaVoAMP/stumpy | d63963caaf6a8b64448953f638c1d3345e05a36a | [
"BSD-3-Clause"
] | null | null | null | stumpy/stimp.py | SaVoAMP/stumpy | d63963caaf6a8b64448953f638c1d3345e05a36a | [
"BSD-3-Clause"
] | null | null | null | # STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import numpy as np
from . import core, stump, scrump, stumped
from .aamp_stimp import aamp_stimp, aamp_stimped
def _normalize_pan(pan, ms, bfs_... | 35.153595 | 88 | 0.61216 |
import numpy as np
from . import core, stump, scrump, stumped
from .aamp_stimp import aamp_stimp, aamp_stimped
def _normalize_pan(pan, ms, bfs_indices, n_processed):
idx = bfs_indices[:n_processed]
norm = 1.0 / (2.0 * np.sqrt(ms[:n_processed]))
pan[idx] = np.minimum(1.0, pan[idx] * norm[:, np.newaxis]... | true | true |
1c28604cfe7827a11d8bed4b8ef0e41fb846af0f | 827 | py | Python | src/pugs/logic.py | gaborbernat/pugs | 7585a2c6775998d9d3946db08629c5d08096088d | [
"MIT"
] | 14 | 2019-02-13T08:41:48.000Z | 2021-09-15T06:59:26.000Z | src/pugs/logic.py | gaborbernat/pugs | 7585a2c6775998d9d3946db08629c5d08096088d | [
"MIT"
] | null | null | null | src/pugs/logic.py | gaborbernat/pugs | 7585a2c6775998d9d3946db08629c5d08096088d | [
"MIT"
] | 3 | 2019-02-14T05:12:09.000Z | 2020-11-09T13:21:31.000Z | from __future__ import unicode_literals
from collections import namedtuple
import random
Quote = namedtuple("Quote", ["msg", "source"])
QUOTES = [
Quote(
msg="As a wise Pug once said, all you need is love, kibble and a de-worming"
" tablet every three to six months.",
source="A Pug's Guid... | 29.535714 | 112 | 0.648126 | from __future__ import unicode_literals
from collections import namedtuple
import random
Quote = namedtuple("Quote", ["msg", "source"])
QUOTES = [
Quote(
msg="As a wise Pug once said, all you need is love, kibble and a de-worming"
" tablet every three to six months.",
source="A Pug's Guid... | true | true |
1c2861aad231b1ea4b4673b25e1d1fef9a09bc45 | 5,586 | py | Python | manage/generate_releasenotes.py | bdraco/integration | b30e799bb27fdd978bd68f21909c82005d0dd3ea | [
"MIT"
] | 2 | 2019-06-18T11:30:53.000Z | 2019-10-03T21:34:11.000Z | manage/generate_releasenotes.py | bdraco/integration | b30e799bb27fdd978bd68f21909c82005d0dd3ea | [
"MIT"
] | 341 | 2019-06-18T11:30:55.000Z | 2021-07-15T05:38:46.000Z | manage/generate_releasenotes.py | bdraco/integration | b30e799bb27fdd978bd68f21909c82005d0dd3ea | [
"MIT"
] | null | null | null | import json
import re
import sys
from github import Github
BODY = """
[](https://github.com/hacs/integration/releases/{version})
{changes}
## Links
- [Discord server for HACS](https://discord.gg/apgchf8)
- [H... | 30.032258 | 165 | 0.612961 | import json
import re
import sys
from github import Github
BODY = """
[](https://github.com/hacs/integration/releases/{version})
{changes}
## Links
- [Discord server for HACS](https://discord.gg/apgchf8)
- [H... | true | true |
1c28636ec32011e0af41b2f4a6d2b70111d697e7 | 9,225 | py | Python | libs/shape.py | nicolalorusso/roLabelImg | 763e69d56e947793463b3e5fee503320e1be0b86 | [
"MIT"
] | null | null | null | libs/shape.py | nicolalorusso/roLabelImg | 763e69d56e947793463b3e5fee503320e1be0b86 | [
"MIT"
] | null | null | null | libs/shape.py | nicolalorusso/roLabelImg | 763e69d56e947793463b3e5fee503320e1be0b86 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
except ImportError:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from lib import distance
import math
DEFAULT_LINE_COLOR = QColor(0, 255, 0, 128)
DEFAULT_FILL_COLOR = QColor(255, 0, 0, 128)
DE... | 33.915441 | 119 | 0.58103 |
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
except ImportError:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from lib import distance
import math
DEFAULT_LINE_COLOR = QColor(0, 255, 0, 128)
DEFAULT_FILL_COLOR = QColor(255, 0, 0, 128)
DEFAULT_SELECT_LINE_COLOR = QColor(255, 25... | true | true |
1c28642a84c4644a6841f8f33fd71d25cd6f0a49 | 11,734 | py | Python | scripts/codegen/generate_system_calls.py | iguessthislldo/os | 4d9b71c196d26af0d60dafbe7123d4e01b939a95 | [
"MIT"
] | 2 | 2018-02-12T10:18:37.000Z | 2018-02-19T13:38:12.000Z | scripts/codegen/generate_system_calls.py | iguessthislldo/os | 4d9b71c196d26af0d60dafbe7123d4e01b939a95 | [
"MIT"
] | null | null | null | scripts/codegen/generate_system_calls.py | iguessthislldo/os | 4d9b71c196d26af0d60dafbe7123d4e01b939a95 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Generates system call interface functions that can be called by programs
# based on the implementation file.
import sys
from pathlib import Path
import re
from subprocess import check_output, PIPE
debug = False
impl_file = Path('kernel/platform/system_calls.zig')
interface_file = Path('libs... | 34.209913 | 97 | 0.547043 |
import sys
from pathlib import Path
import re
from subprocess import check_output, PIPE
debug = False
impl_file = Path('kernel/platform/system_calls.zig')
interface_file = Path('libs/georgios/system_calls.zig')
this_file = Path(__file__)
syscall_error_values_file = Path('tmp/syscall_error_values.zig')
int_num =... | true | true |
1c28644cccaa9b7ccc104007acdb7fe41da7c7ad | 1,198 | py | Python | python/graphscope/experimental/nx/tests/algorithms/forward/operators/test_product.py | wenyuanyu/GraphScope | a40ccaf70557e608d8b091eb25ab04477f99ce21 | [
"Apache-2.0"
] | 2 | 2020-12-15T08:42:10.000Z | 2022-01-14T09:13:16.000Z | python/graphscope/experimental/nx/tests/algorithms/forward/operators/test_product.py | wenyuanyu/GraphScope | a40ccaf70557e608d8b091eb25ab04477f99ce21 | [
"Apache-2.0"
] | 1 | 2020-12-22T13:15:40.000Z | 2020-12-22T13:15:40.000Z | python/graphscope/experimental/nx/tests/algorithms/forward/operators/test_product.py | wenyuanyu/GraphScope | a40ccaf70557e608d8b091eb25ab04477f99ce21 | [
"Apache-2.0"
] | 1 | 2021-11-23T03:40:43.000Z | 2021-11-23T03:40:43.000Z | import networkx.algorithms.operators.tests.test_product
import pytest
from graphscope.experimental.nx.utils.compat import import_as_graphscope_nx
import_as_graphscope_nx(networkx.algorithms.operators.tests.test_product,
decorators=pytest.mark.usefixtures("graphscope_session"))
def test_tenso... | 27.860465 | 81 | 0.724541 | import networkx.algorithms.operators.tests.test_product
import pytest
from graphscope.experimental.nx.utils.compat import import_as_graphscope_nx
import_as_graphscope_nx(networkx.algorithms.operators.tests.test_product,
decorators=pytest.mark.usefixtures("graphscope_session"))
def test_tenso... | true | true |
1c2864a2bdd78822b669b80b46b9d38299caecda | 2,279 | py | Python | src/data_collection/preprocess_data/make_csv.py | GrigalashviliT/spoilerBlocker | 18a5e9689099d3b631a15ed20cc84a043f324055 | [
"MIT"
] | 5 | 2020-05-20T16:59:04.000Z | 2021-08-22T18:30:47.000Z | src/data_collection/preprocess_data/make_csv.py | GrigalashviliT/spoilerBlocker | 18a5e9689099d3b631a15ed20cc84a043f324055 | [
"MIT"
] | 10 | 2020-05-20T16:07:04.000Z | 2020-07-22T19:21:16.000Z | src/data_collection/preprocess_data/make_csv.py | GrigalashviliT/spoilerBlocker | 18a5e9689099d3b631a15ed20cc84a043f324055 | [
"MIT"
] | null | null | null | import pandas as pd
import glob
from re import sub
dct = {
'sentence': [],
'label': []
}
def process_text(text):
text = text.replace('\r\n', '.')
text = text.replace('\n', '.')
text = text.replace('\r', '.')
text = text.lower()
text = text.strip().split('.')
retu... | 23.255102 | 60 | 0.448881 | import pandas as pd
import glob
from re import sub
dct = {
'sentence': [],
'label': []
}
def process_text(text):
text = text.replace('\r\n', '.')
text = text.replace('\n', '.')
text = text.replace('\r', '.')
text = text.lower()
text = text.strip().split('.')
retu... | true | true |
1c28654704522dfcc91b1351cb02b23c007bc10f | 2,265 | py | Python | minset.py | pan0625/pan | 410d7acdecffb6e614522b24ab42765307baf868 | [
"MIT"
] | null | null | null | minset.py | pan0625/pan | 410d7acdecffb6e614522b24ab42765307baf868 | [
"MIT"
] | null | null | null | minset.py | pan0625/pan | 410d7acdecffb6e614522b24ab42765307baf868 | [
"MIT"
] | null | null | null | import networkx as nx
import operator
import random
G = nx.read_gexf("testba4.gexf")
'''G = nx.read_gml('dolphin.gml')'''
'''G = nx.read_gexf("dolphin.gml")'''
'''G = nx.karate_club_graph()'''
nodes = G.nodes()
listnodes = {}
neighbors = {}
payofflist = {}
for n in nodes:
listnodes[n] ="D"
ne... | 22.878788 | 96 | 0.428698 | import networkx as nx
import operator
import random
G = nx.read_gexf("testba4.gexf")
nodes = G.nodes()
listnodes = {}
neighbors = {}
payofflist = {}
for n in nodes:
listnodes[n] ="D"
neighbors[n] = G.neighbors(n)
payofflist[n] = 0
nodes2 = nx.degree(G)
sortednodes2 = sorted(nodes2.items... | true | true |
1c28659d46cb51f7ef1685ef452f77d7ade28727 | 269 | py | Python | init.py | kyehyeon/SNIPER | 2b8723729bfb91275d598b55752f32d8a00a33ad | [
"Apache-2.0"
] | 2,722 | 2018-06-18T10:01:29.000Z | 2022-03-12T09:46:06.000Z | init.py | kyehyeon/SNIPER | 2b8723729bfb91275d598b55752f32d8a00a33ad | [
"Apache-2.0"
] | 184 | 2018-06-18T11:35:54.000Z | 2021-10-19T11:31:56.000Z | init.py | kyehyeon/SNIPER | 2b8723729bfb91275d598b55752f32d8a00a33ad | [
"Apache-2.0"
] | 486 | 2018-06-18T08:55:24.000Z | 2022-02-21T15:51:39.000Z | import sys
import logging
import os
import matplotlib
matplotlib.use('Agg')
os.environ['PYTHONUNBUFFERED'] = '1'
os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
logging.basicConfig(level=logging.INFO)
sys.path.insert(0,'lib')
sys.path.insert(0,'SNIPER-mxnet/python')
| 22.416667 | 48 | 0.773234 | import sys
import logging
import os
import matplotlib
matplotlib.use('Agg')
os.environ['PYTHONUNBUFFERED'] = '1'
os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
logging.basicConfig(level=logging.INFO)
sys.path.insert(0,'lib')
sys.path.insert(0,'SNIPER-mxnet/python')
| true | true |
1c2865ce773c47280e24a747de8457e9fe369930 | 5,276 | py | Python | puzzles/minesweeper/python/minesweeper.py | CarbonDDR/al-go-rithms | 8e65affbe812931b7dde0e2933eb06c0f44b4130 | [
"CC0-1.0"
] | 1,253 | 2017-06-06T07:19:25.000Z | 2022-03-30T17:07:58.000Z | puzzles/minesweeper/python/minesweeper.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 554 | 2017-09-29T18:56:01.000Z | 2022-02-21T15:48:13.000Z | puzzles/minesweeper/python/minesweeper.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 2,226 | 2017-09-29T19:59:59.000Z | 2022-03-25T08:59:55.000Z |
import random
class Cell(object):
def __init__(self, is_mine, is_visible=False, is_flagged=False):
self.is_mine = is_mine
self.is_visible = is_visible
self.is_flagged = is_flagged
def show(self):
self.is_visible = True
def flag(self):
self.is_flagged = not self.is... | 32.975 | 104 | 0.539234 |
import random
class Cell(object):
def __init__(self, is_mine, is_visible=False, is_flagged=False):
self.is_mine = is_mine
self.is_visible = is_visible
self.is_flagged = is_flagged
def show(self):
self.is_visible = True
def flag(self):
self.is_flagged = not self.is... | true | true |
1c2865ec283f2dfdf4b6fea9ccb5ea06d0eded6e | 19,030 | py | Python | nova/tests/unit/conductor/tasks/test_live_migrate.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | 4 | 2015-04-13T14:52:41.000Z | 2018-02-03T19:32:13.000Z | nova/tests/unit/conductor/tasks/test_live_migrate.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/conductor/tasks/test_live_migrate.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | 2 | 2015-10-10T05:30:38.000Z | 2020-07-24T01:56:46.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 46.871921 | 79 | 0.667998 |
from mox3 import mox
from nova.compute import power_state
from nova.compute import utils as compute_utils
from nova.conductor.tasks import live_migrate
from nova import exception
from nova import objects
from nova.scheduler import utils as scheduler_utils
from nova import test
from nova.tests.unit import f... | true | true |
1c28661ef85d052fecedd212a0e6458f7e626a95 | 689 | py | Python | python/extremeText/__init__.py | mwydmuch/fastText | 0a9274cfef517aeef47de5e0078933889ca35f68 | [
"BSD-3-Clause"
] | 144 | 2018-10-28T02:39:05.000Z | 2022-03-21T10:36:03.000Z | python/extremeText/__init__.py | Marqt/fastText | 0a9274cfef517aeef47de5e0078933889ca35f68 | [
"BSD-3-Clause"
] | 9 | 2018-10-28T08:01:38.000Z | 2020-09-17T13:45:07.000Z | python/extremeText/__init__.py | Marqt/fastText | 0a9274cfef517aeef47de5e0078933889ca35f68 | [
"BSD-3-Clause"
] | 19 | 2018-12-18T13:32:50.000Z | 2021-01-25T11:46:40.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import a... | 34.45 | 77 | 0.822932 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .ExtremeText import train_supervised
from .ExtremeText import train_unsupervised
from .ExtremeText import load_model
from .ExtremeText import tokenize
from .E... | true | true |
1c2866b837763c64b71780243ea635a0768d4d94 | 1,299 | py | Python | src/swarm_rescue/tuto_spg_jupyter/tuto_02_03_rooms.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 5 | 2021-11-11T12:19:00.000Z | 2022-03-09T08:47:37.000Z | src/swarm_rescue/tuto_spg_jupyter/tuto_02_03_rooms.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 4 | 2021-11-06T17:19:11.000Z | 2022-02-16T11:46:54.000Z | src/swarm_rescue/tuto_spg_jupyter/tuto_02_03_rooms.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 3 | 2021-11-10T17:14:55.000Z | 2021-11-22T16:32:17.000Z | from simple_playgrounds.element.elements.basic import Physical
from simple_playgrounds.common.position_utils import CoordinateSampler
from simple_playgrounds.playground import GridRooms
from simple_playgrounds.engine import Engine
# matplotlib inline
import matplotlib.pyplot as plt
def plt_image(img):
plt.axis('... | 34.184211 | 91 | 0.729792 | from simple_playgrounds.element.elements.basic import Physical
from simple_playgrounds.common.position_utils import CoordinateSampler
from simple_playgrounds.playground import GridRooms
from simple_playgrounds.engine import Engine
import matplotlib.pyplot as plt
def plt_image(img):
plt.axis('off')
plt.imsho... | true | true |
1c28683ade3b025ca827addd6d21ab81cf04e580 | 13,272 | py | Python | log_mito_act/model_537.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_537.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_537.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'X... | 79.473054 | 614 | 0.80975 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'Xiap'])
Monomer('Fadd', ['Receptor'... | true | true |
1c2868d84cb76bdb07e982a72bef09da05a81eef | 114 | py | Python | glue/viewers/table/__init__.py | ejeschke/glue | 21689e3474aeaeb70e258d76c60755596856976c | [
"BSD-3-Clause"
] | null | null | null | glue/viewers/table/__init__.py | ejeschke/glue | 21689e3474aeaeb70e258d76c60755596856976c | [
"BSD-3-Clause"
] | null | null | null | glue/viewers/table/__init__.py | ejeschke/glue | 21689e3474aeaeb70e258d76c60755596856976c | [
"BSD-3-Clause"
] | null | null | null | def setup():
from glue.config import qt_client
from .qt import TableViewer
qt_client.add(TableViewer)
| 22.8 | 37 | 0.72807 | def setup():
from glue.config import qt_client
from .qt import TableViewer
qt_client.add(TableViewer)
| true | true |
1c286a016ff53e53cdfd78b1241ee75e3bf3395e | 3,688 | py | Python | gs_extensions/gnome_shell_extension_wrapper.py | ilyachch/gnome_shell_extensions_install_tool | e1e19b4d390db99e243fa0e0cd4466fd843482c9 | [
"MIT"
] | null | null | null | gs_extensions/gnome_shell_extension_wrapper.py | ilyachch/gnome_shell_extensions_install_tool | e1e19b4d390db99e243fa0e0cd4466fd843482c9 | [
"MIT"
] | 4 | 2019-03-25T07:27:45.000Z | 2020-01-16T14:54:07.000Z | gs_extensions/gnome_shell_extension_wrapper.py | ilyachch/gs_extensions | e1e19b4d390db99e243fa0e0cd4466fd843482c9 | [
"MIT"
] | null | null | null | import os
import subprocess
import tempfile
import zipfile
import requests
from gs_extensions.exceptions import NoExtensionVersionForGnomeShell, ExtensionNotFoundInHub
class GnomeShellExtensionWrapper:
EXTENSIONS_API_URL = 'https://extensions.gnome.org/ajax/detail/'
DOWNLOAD_LINK_TPL = 'https://extensions.... | 36.88 | 108 | 0.680857 | import os
import subprocess
import tempfile
import zipfile
import requests
from gs_extensions.exceptions import NoExtensionVersionForGnomeShell, ExtensionNotFoundInHub
class GnomeShellExtensionWrapper:
EXTENSIONS_API_URL = 'https://extensions.gnome.org/ajax/detail/'
DOWNLOAD_LINK_TPL = 'https://extensions.... | true | true |
1c286a01a81a4fb0d9e2dfb76694133b9a13deba | 3,062 | py | Python | mwlib/treecleanerhelper.py | h4ck3rm1k3/mwlib | 11475c6ad7480e35a4a59f276c47f6a5203435cc | [
"Unlicense"
] | 1 | 2019-04-27T20:14:53.000Z | 2019-04-27T20:14:53.000Z | mwlib/treecleanerhelper.py | h4ck3rm1k3/mwlib | 11475c6ad7480e35a4a59f276c47f6a5203435cc | [
"Unlicense"
] | null | null | null | mwlib/treecleanerhelper.py | h4ck3rm1k3/mwlib | 11475c6ad7480e35a4a59f276c47f6a5203435cc | [
"Unlicense"
] | null | null | null | #! /usr/bin/env python
#! -*- coding:utf-8 -*-
# Copyright (c) 2007, PediaPress GmbH
# See README.rst for additional licensing information.
import math
from advtree import Cell, ImageLink, Link, Math, NamedURL, Reference, Text, URL
def getNodeHeight(node, params):
lineHeight = params['lineHeight']
charsPerL... | 35.604651 | 145 | 0.584585 |
import math
from advtree import Cell, ImageLink, Link, Math, NamedURL, Reference, Text, URL
def getNodeHeight(node, params):
lineHeight = params['lineHeight']
charsPerLine = params['charsPerLine']
paragraphMargin = params['paragraphMargin']
imgHeight = params['imgHeight']
height = 0
... | true | true |
1c286a432bd7094910e4e8fc73f9ba28ef9b12d9 | 1,138 | py | Python | maskrcnn_benchmark/data/datasets/evaluation/__init__.py | Loranet-Technologies/traffic-analysis | e1e50b6c36b3da6279678c679500a8cf4e62ccef | [
"MIT"
] | 14 | 2019-10-18T07:54:40.000Z | 2021-11-07T11:43:04.000Z | maskrcnn_benchmark/data/datasets/evaluation/__init__.py | Loranet-Technologies/traffic-analysis | e1e50b6c36b3da6279678c679500a8cf4e62ccef | [
"MIT"
] | 7 | 2019-10-25T17:10:02.000Z | 2022-03-12T00:04:54.000Z | maskrcnn_benchmark/data/datasets/evaluation/__init__.py | Moonlydark/traffic-analysis | e1e50b6c36b3da6279678c679500a8cf4e62ccef | [
"MIT"
] | 13 | 2019-10-18T07:54:43.000Z | 2022-01-21T23:16:33.000Z | from maskrcnn_benchmark.data import datasets
from .coco import coco_evaluation
from .voc import voc_evaluation
from .traffic import traffic_evaluation
def evaluate(dataset, predictions, output_folder, **kwargs):
"""evaluate dataset using different methods based on dataset type.
Args:
dataset: Dataset... | 36.709677 | 87 | 0.714411 | from maskrcnn_benchmark.data import datasets
from .coco import coco_evaluation
from .voc import voc_evaluation
from .traffic import traffic_evaluation
def evaluate(dataset, predictions, output_folder, **kwargs):
args = dict(
dataset=dataset, predictions=predictions, output_folder=output_folder, **kwargs
... | true | true |
1c286bf2262d0711e64b90077cb8b87e488977ce | 311 | py | Python | advancing_hero/screen/screen.py | hentt30/ces22-project | 06f13ebdf06bbab182b83c882846701ab69e8631 | [
"MIT"
] | 1 | 2021-04-12T01:27:34.000Z | 2021-04-12T01:27:34.000Z | advancing_hero/screen/screen.py | hentt30/ces22-project | 06f13ebdf06bbab182b83c882846701ab69e8631 | [
"MIT"
] | null | null | null | advancing_hero/screen/screen.py | hentt30/ces22-project | 06f13ebdf06bbab182b83c882846701ab69e8631 | [
"MIT"
] | 2 | 2021-04-01T00:13:51.000Z | 2021-04-11T07:15:54.000Z | import pygame
class Screen():
def __init__(
self,
background_path: str = "advancing-hero/images/Sample_fantasy.png"
) -> None:
self.background = pygame.image.load(background_path).convert()
def render(self) -> None:
#Display refresh
pygame.display.flip()
| 20.733333 | 73 | 0.62701 | import pygame
class Screen():
def __init__(
self,
background_path: str = "advancing-hero/images/Sample_fantasy.png"
) -> None:
self.background = pygame.image.load(background_path).convert()
def render(self) -> None:
pygame.display.flip()
| true | true |
1c286c0cadb0ef973002a310b250d14b98316439 | 21,446 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.96347 | 204 | 0.665532 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
1c286ced002b07e3abe2f67d7a28ed393e055bbf | 5,140 | py | Python | qr_code/views.py | chrissam/django-qr-code | bd3b5e554bda09f4fdc1da298286f649d64dcc8a | [
"BSD-3-Clause"
] | null | null | null | qr_code/views.py | chrissam/django-qr-code | bd3b5e554bda09f4fdc1da298286f649d64dcc8a | [
"BSD-3-Clause"
] | null | null | null | qr_code/views.py | chrissam/django-qr-code | bd3b5e554bda09f4fdc1da298286f649d64dcc8a | [
"BSD-3-Clause"
] | null | null | null | import base64
import binascii
from io import BytesIO
from django.conf import settings
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.core.signing import BadSignature, Signer
from django.http import HttpResponse
from functools import wraps
from django.views.decorators.cache import ... | 46.727273 | 170 | 0.734241 | import base64
import binascii
from io import BytesIO
from django.conf import settings
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.core.signing import BadSignature, Signer
from django.http import HttpResponse
from functools import wraps
from django.views.decorators.cache import ... | true | true |
1c286def6875ef2725bf68e61afe7518d2bfe286 | 525 | py | Python | env/Lib/site-packages/plotly/validators/histogram2d/hoverlabel/_namelength.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/histogram2d/hoverlabel/_namelength.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/histogram2d/hoverlabel/_namelength.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="namelength", parent_name="histogram2d.hoverlabel", **kwargs
):
super(NamelengthValidator, self).__init__(
plotly_name=plotly_name,
... | 32.8125 | 86 | 0.64 | import _plotly_utils.basevalidators
class NamelengthValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="namelength", parent_name="histogram2d.hoverlabel", **kwargs
):
super(NamelengthValidator, self).__init__(
plotly_name=plotly_name,
... | true | true |
1c286e34c6ff7de79a8a0530387192d565abd9b7 | 4,539 | py | Python | bot.py | SA7BNT/hikvision-camera-bot | a77f2ee48aaf1338ef0c3161af3b3260c94bd3d1 | [
"MIT"
] | null | null | null | bot.py | SA7BNT/hikvision-camera-bot | a77f2ee48aaf1338ef0c3161af3b3260c94bd3d1 | [
"MIT"
] | null | null | null | bot.py | SA7BNT/hikvision-camera-bot | a77f2ee48aaf1338ef0c3161af3b3260c94bd3d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Bot Launcher Module."""
import logging
import itertools
import sys
from collections import defaultdict
from telegram.ext import CommandHandler, Updater
from camerabot.camerabot import CameraBot
from camerabot.config import get_main_config
from camerabot.constants import LOG_LEVELS_STR
from ... | 34.915385 | 79 | 0.640229 |
import logging
import itertools
import sys
from collections import defaultdict
from telegram.ext import CommandHandler, Updater
from camerabot.camerabot import CameraBot
from camerabot.config import get_main_config
from camerabot.constants import LOG_LEVELS_STR
from camerabot.directorywatcher import DirectoryWatche... | true | true |
1c286e39f0c5c54850b4a4ddb71230a6095d5be5 | 2,658 | py | Python | diet-ml/ml-submit.py | makaishi2/cplex-samples | d798a8d2dc14826eb5b3f00e6f64a2a08b2bc5f1 | [
"Apache-2.0"
] | null | null | null | diet-ml/ml-submit.py | makaishi2/cplex-samples | d798a8d2dc14826eb5b3f00e6f64a2a08b2bc5f1 | [
"Apache-2.0"
] | null | null | null | diet-ml/ml-submit.py | makaishi2/cplex-samples | d798a8d2dc14826eb5b3f00e6f64a2a08b2bc5f1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# コマンドによる事前準備
# $ pip install -U ibm-watson-machine-learning
import sys
# Watson ML credentails
apikey = 'xxxx'
location = 'us-south'
import pandas as pd
# Watson ML credentails
# DO Deployment ID
deployment_uid = 'xxxx'
# Input CSV File
input_data1 = 'diet_food.csv'
input_data2 = 'diet_... | 26.058824 | 119 | 0.57073 |
import sys
apikey = 'xxxx'
location = 'us-south'
import pandas as pd
deployment_uid = 'xxxx'
input_data1 = 'diet_food.csv'
input_data2 = 'diet_nutrients.csv'
input_data3 = 'diet_food_nutrients.csv'
if __name__ == '__main__':
argv = sys.argv
argc = len(argv)
wml_credentials = {
... | true | true |
1c286f1f2eb8949cf8b2845a0a2eb8015734c718 | 1,544 | py | Python | matrix/ops/transpose.py | wesselb/matrix | ba343d69945d7cbc67330d01a87eee363ce5d408 | [
"MIT"
] | 3 | 2021-07-30T17:38:08.000Z | 2021-11-21T04:41:40.000Z | matrix/ops/transpose.py | wesselb/matrix | ba343d69945d7cbc67330d01a87eee363ce5d408 | [
"MIT"
] | null | null | null | matrix/ops/transpose.py | wesselb/matrix | ba343d69945d7cbc67330d01a87eee363ce5d408 | [
"MIT"
] | null | null | null | import lab as B
from lab.util import resolve_axis
from ..constant import Constant, Zero
from ..diagonal import Diagonal
from ..kronecker import Kronecker
from ..lowrank import LowRank
from ..matrix import Dense
from ..tiledblocks import TiledBlocks
from ..triangular import LowerTriangular, UpperTriangular
from ..woodb... | 20.864865 | 77 | 0.70013 | import lab as B
from lab.util import resolve_axis
from ..constant import Constant, Zero
from ..diagonal import Diagonal
from ..kronecker import Kronecker
from ..lowrank import LowRank
from ..matrix import Dense
from ..tiledblocks import TiledBlocks
from ..triangular import LowerTriangular, UpperTriangular
from ..woodb... | true | true |
1c286f288caac65c7e8cd492e0a8b6d04ac5973c | 55 | py | Python | test/config.py | Springf/mQ | 6a28b4e9de22fe27ce5a35efa11c83c5f066df0a | [
"MIT"
] | null | null | null | test/config.py | Springf/mQ | 6a28b4e9de22fe27ce5a35efa11c83c5f066df0a | [
"MIT"
] | null | null | null | test/config.py | Springf/mQ | 6a28b4e9de22fe27ce5a35efa11c83c5f066df0a | [
"MIT"
] | null | null | null | DATABASE_CONFIG = {
'dbname': 'questions_test.db'
} | 18.333333 | 33 | 0.672727 | DATABASE_CONFIG = {
'dbname': 'questions_test.db'
} | true | true |
1c2871ef459b37b79697d4b091712ce065bf59c8 | 3,362 | py | Python | plot.py | Ravirajanan/tennislive-visualization | f5d555a9caea61c1286cc7bc3505281f52d37322 | [
"Apache-2.0"
] | null | null | null | plot.py | Ravirajanan/tennislive-visualization | f5d555a9caea61c1286cc7bc3505281f52d37322 | [
"Apache-2.0"
] | null | null | null | plot.py | Ravirajanan/tennislive-visualization | f5d555a9caea61c1286cc7bc3505281f52d37322 | [
"Apache-2.0"
] | null | null | null | #imports
import pandas as pd
import numpy as np
import re
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
#reads the input file which ha... | 31.12963 | 130 | 0.716538 |
import pandas as pd
import numpy as np
import re
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
dataframe = pd.read_csv('Melbourne_06... | true | true |
1c2872645c3580b560b396abcde0246ee067a6d0 | 22,978 | py | Python | tests/test_image.py | catmaid/catpy | 481d87591a6dfaedef2767dcddcbed7185ecc8b8 | [
"MIT"
] | 5 | 2018-04-24T15:45:31.000Z | 2021-06-18T17:38:07.000Z | tests/test_image.py | catmaid/catpy | 481d87591a6dfaedef2767dcddcbed7185ecc8b8 | [
"MIT"
] | 35 | 2017-05-12T21:49:54.000Z | 2022-03-12T00:47:09.000Z | tests/test_image.py | catmaid/catpy | 481d87591a6dfaedef2767dcddcbed7185ecc8b8 | [
"MIT"
] | 4 | 2017-08-24T12:15:41.000Z | 2019-10-13T01:05:34.000Z | from __future__ import absolute_import
from itertools import cycle, chain
import pytest
import numpy as np
import requests
from PIL import Image
from io import BytesIO
from concurrent.futures import Future
from requests import HTTPError
try:
import mock
except ImportError:
from unittest import mock
from cat... | 28.228501 | 105 | 0.652581 | from __future__ import absolute_import
from itertools import cycle, chain
import pytest
import numpy as np
import requests
from PIL import Image
from io import BytesIO
from concurrent.futures import Future
from requests import HTTPError
try:
import mock
except ImportError:
from unittest import mock
from cat... | true | true |
1c28731067440749f4308cd14ccdb9ea40b04122 | 627 | py | Python | Beecrowd/Python/1049.py | felipemsalles/Programming-Studies | 63100fb22a165c4582b10a95d5a583f9bc1e990f | [
"MIT"
] | null | null | null | Beecrowd/Python/1049.py | felipemsalles/Programming-Studies | 63100fb22a165c4582b10a95d5a583f9bc1e990f | [
"MIT"
] | null | null | null | Beecrowd/Python/1049.py | felipemsalles/Programming-Studies | 63100fb22a165c4582b10a95d5a583f9bc1e990f | [
"MIT"
] | null | null | null | primeira = str(input()).lower()
segunda = str(input()).lower()
terceira = str(input()).lower()
if primeira == 'vertebrado':
if segunda == 'ave':
if terceira == 'carnivoro':
print('aguia')
else:
print('pomba')
else:
if terceira == 'onivoro':
print('home... | 25.08 | 36 | 0.481659 | primeira = str(input()).lower()
segunda = str(input()).lower()
terceira = str(input()).lower()
if primeira == 'vertebrado':
if segunda == 'ave':
if terceira == 'carnivoro':
print('aguia')
else:
print('pomba')
else:
if terceira == 'onivoro':
print('home... | true | true |
1c287333426964173b3e1ed47696b8ea64c77b00 | 2,335 | py | Python | UNet/model.py | note-nota/ML_models | e9ede1b5cc3ef7bab43f22467cb806043d86e451 | [
"MIT"
] | null | null | null | UNet/model.py | note-nota/ML_models | e9ede1b5cc3ef7bab43f22467cb806043d86e451 | [
"MIT"
] | null | null | null | UNet/model.py | note-nota/ML_models | e9ede1b5cc3ef7bab43f22467cb806043d86e451 | [
"MIT"
] | null | null | null | from typing import Optional
import argparse
import tensorflow as tf
class conv_set:
def __init__(self, filters: int):
self.filters = filters
def __call__(self, inputs: tf.Tensor) -> tf.Tensor:
y = tf.keras.layers.Conv2D(
self.filters, kernel_size=3, padding="SAME", activation="rel... | 30.723684 | 76 | 0.647537 | from typing import Optional
import argparse
import tensorflow as tf
class conv_set:
def __init__(self, filters: int):
self.filters = filters
def __call__(self, inputs: tf.Tensor) -> tf.Tensor:
y = tf.keras.layers.Conv2D(
self.filters, kernel_size=3, padding="SAME", activation="rel... | true | true |
1c2873eb759110e49eeae4c4f20f562745fbd253 | 4,159 | py | Python | homeassistant/components/baf/config_flow.py | SNoof85/core | 5f44d0f8f9db03371164ff596f7b09615a5f6efe | [
"Apache-2.0"
] | null | null | null | homeassistant/components/baf/config_flow.py | SNoof85/core | 5f44d0f8f9db03371164ff596f7b09615a5f6efe | [
"Apache-2.0"
] | 9 | 2022-01-26T06:25:01.000Z | 2022-03-31T06:27:15.000Z | homeassistant/components/baf/config_flow.py | SNoof85/core | 5f44d0f8f9db03371164ff596f7b09615a5f6efe | [
"Apache-2.0"
] | null | null | null | """Config flow for baf."""
from __future__ import annotations
import asyncio
import logging
from typing import Any
from aiobafi6 import Device, Service
from aiobafi6.discovery import PORT
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistan... | 34.371901 | 82 | 0.640779 | from __future__ import annotations
import asyncio
import logging
from typing import Any
from aiobafi6 import Device, Service
from aiobafi6.discovery import PORT
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistant.const import CONF_IP_ADDR... | true | true |
1c2874643725f3d10c31f2f3791eb1b3cd82f603 | 8,646 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20190901/get_nat_gateway.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20190901/get_nat_gateway.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20190901/get_nat_gateway.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 36.175732 | 257 | 0.644113 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetNatGatewayResult',
'AwaitableGetNatGatewayResult',
'get_nat_gateway',
]
@pulumi.output_type
class GetNatGatewayResult... | true | true |
1c28746e0ae8c3d2fa715eccac69e5bf50f19280 | 2,083 | py | Python | pyimp/girl/dimensions.py | ismaelharunid/girl | 78c703e2788808b0fb2033577e827dcbdb59b797 | [
"MIT"
] | 1 | 2020-06-14T13:42:17.000Z | 2020-06-14T13:42:17.000Z | pyimp/girl/dimensions.py | ismaelharunid/girl | 78c703e2788808b0fb2033577e827dcbdb59b797 | [
"MIT"
] | null | null | null | pyimp/girl/dimensions.py | ismaelharunid/girl | 78c703e2788808b0fb2033577e827dcbdb59b797 | [
"MIT"
] | null | null | null |
from .common import *
from .typehelpers import *
from .interfaces import Area
class Size(object):
def __init__(self, initialzer):
if isinstance(initialzer, Iterable):
size = tuple(int(c) for c in initialzer)
if len(size) == 2:
self._size = size
return
raise ValueError("Size e... | 21.040404 | 81 | 0.629861 |
from .common import *
from .typehelpers import *
from .interfaces import Area
class Size(object):
def __init__(self, initialzer):
if isinstance(initialzer, Iterable):
size = tuple(int(c) for c in initialzer)
if len(size) == 2:
self._size = size
return
raise ValueError("Size e... | true | true |
1c28750c6a39b97a3d0c516caec5a612eecb0a76 | 1,192 | py | Python | setup.py | cchristelis/katsdpdata | a51b6ff23810996ddb7582f28c01319b7f125e81 | [
"BSD-3-Clause"
] | null | null | null | setup.py | cchristelis/katsdpdata | a51b6ff23810996ddb7582f28c01319b7f125e81 | [
"BSD-3-Clause"
] | 10 | 2020-02-26T11:01:21.000Z | 2021-09-13T10:28:19.000Z | setup.py | cchristelis/katsdpdata | a51b6ff23810996ddb7582f28c01319b7f125e81 | [
"BSD-3-Clause"
] | 1 | 2021-02-12T13:59:11.000Z | 2021-02-12T13:59:11.000Z | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name="katsdpdata",
description="Data search and retrieval library for the MeerKAT project",
author="Thomas Bennett, Chris Schollar",
author_email="thomas@ska.ac.za, cschollar@ska.ac.za",
packages=find_packages(),
install... | 31.368421 | 76 | 0.627517 |
from setuptools import setup, find_packages
setup(
name="katsdpdata",
description="Data search and retrieval library for the MeerKAT project",
author="Thomas Bennett, Chris Schollar",
author_email="thomas@ska.ac.za, cschollar@ska.ac.za",
packages=find_packages(),
install_requires=[
"b... | true | true |
1c28760e67743491111d460b3c17cf3a02a08998 | 9,529 | py | Python | art/attacks/universal_perturbation.py | Viktour19/adversarial-robustness-toolbox | 96ba28170d0de1b5db6a16330a312248cc3b8972 | [
"MIT"
] | 1 | 2019-04-14T23:18:02.000Z | 2019-04-14T23:18:02.000Z | art/attacks/universal_perturbation.py | Viktour19/adversarial-robustness-toolbox | 96ba28170d0de1b5db6a16330a312248cc3b8972 | [
"MIT"
] | null | null | null | art/attacks/universal_perturbation.py | Viktour19/adversarial-robustness-toolbox | 96ba28170d0de1b5db6a16330a312248cc3b8972 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) IBM Corporation 2018
#
# 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... | 43.117647 | 120 | 0.625354 |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import random
import numpy as np
from art.attacks.attack import Attack
from art.utils import projection
logger = logging.getLogger(__name__)
class UniversalPerturbation(Attack):
attacks_dict = {'... | true | true |
1c2877687ec7a29923701ac0bec5e38b63dee49c | 8,794 | py | Python | vision/assignment1/cs231n/classifiers/k_nearest_neighbor.py | TerenceWangh/course | 6bb26097aca8124f07314857b07f78870293045b | [
"MIT"
] | 2 | 2019-12-14T05:31:32.000Z | 2022-03-17T04:05:41.000Z | vision/assignment1/cs231n/classifiers/k_nearest_neighbor.py | TerenceWangh/course | 6bb26097aca8124f07314857b07f78870293045b | [
"MIT"
] | 11 | 2020-03-24T17:08:18.000Z | 2022-03-12T01:02:06.000Z | vision/assignment1/cs231n/classifiers/k_nearest_neighbor.py | TerenceWangh/course | 6bb26097aca8124f07314857b07f78870293045b | [
"MIT"
] | null | null | null | from builtins import range
from builtins import object
import numpy as np
from past.builtins import xrange
class KNearestNeighbor(object):
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
"""
Train the classifier. For k-nearest neighbors t... | 47.026738 | 86 | 0.478622 | from builtins import range
from builtins import object
import numpy as np
from past.builtins import xrange
class KNearestNeighbor(object):
def __init__(self):
pass
def train(self, X, y):
self.X_train = X
self.y_train = y
def predict(self, X, k=1, num_loops=0):
if num_loo... | true | true |
1c287799f5fba3d75a172f0d8fa19fbe3b7d6c5b | 36,629 | py | Python | Lib/site-packages/spyder/plugins/outlineexplorer/widgets.py | hirorin-demon/hirorin-streamlit | 03fbb6f03ec94f909d451e708a3b30b177607695 | [
"0BSD"
] | null | null | null | Lib/site-packages/spyder/plugins/outlineexplorer/widgets.py | hirorin-demon/hirorin-streamlit | 03fbb6f03ec94f909d451e708a3b30b177607695 | [
"0BSD"
] | null | null | null | Lib/site-packages/spyder/plugins/outlineexplorer/widgets.py | hirorin-demon/hirorin-streamlit | 03fbb6f03ec94f909d451e708a3b30b177607695 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Outline explorer widgets."""
# Standard library imports
import bisect
import os.path as osp
import uuid
# Third party imports
from intervaltree import IntervalTr... | 35.424565 | 78 | 0.608261 |
import bisect
import os.path as osp
import uuid
from intervaltree import IntervalTree
from qtpy.compat import from_qvariant
from qtpy.QtCore import Qt, QTimer, Signal, Slot
from qtpy.QtWidgets import (QHBoxLayout, QTreeWidgetItem,
QTreeWidgetItemIterator)
from spyder.api.config.d... | true | true |
1c28780111e6015e8c274024325d4c73b3c6c84d | 778 | py | Python | fairseq/criterions/__init__.py | nedo0shki/fairseq-editor | a0f09787bc0d302be5833ec0dad3e568440f4551 | [
"MIT"
] | 651 | 2015-03-14T23:18:44.000Z | 2022-01-19T14:08:28.000Z | fairseq/criterions/__init__.py | ayu1812/fairseq | a87cafda718c7706e6f1694f0d39fc589ed2b264 | [
"MIT"
] | 362 | 2015-01-26T16:20:28.000Z | 2022-01-26T06:19:23.000Z | fairseq/criterions/__init__.py | ayu1812/fairseq | a87cafda718c7706e6f1694f0d39fc589ed2b264 | [
"MIT"
] | 169 | 2015-09-28T17:06:28.000Z | 2021-12-18T16:02:49.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import importlib
import os
from fairseq import registry
from fairseq.criterions.fairseq_criterion import FairseqCriterion, LegacyFairseqCrite... | 31.12 | 89 | 0.758355 |
import importlib
import os
from fairseq import registry
from fairseq.criterions.fairseq_criterion import FairseqCriterion, LegacyFairseqCriterion
build_criterion, register_criterion, CRITERION_REGISTRY = registry.setup_registry(
'--criterion',
base_class=FairseqCriterion,
default='cross_entropy',
)
... | true | true |
1c287820c9ee9e808dfa9e5a2e41de852759aef7 | 2,932 | py | Python | creten/indicators/Ichimoku.py | nardew/Creten | 15ddb0b52e6f2afec2c79b3c731fccb34a2c63d6 | [
"MIT"
] | 9 | 2019-12-17T10:42:40.000Z | 2021-12-02T23:07:05.000Z | creten/indicators/Ichimoku.py | nardew/Creten | 15ddb0b52e6f2afec2c79b3c731fccb34a2c63d6 | [
"MIT"
] | null | null | null | creten/indicators/Ichimoku.py | nardew/Creten | 15ddb0b52e6f2afec2c79b3c731fccb34a2c63d6 | [
"MIT"
] | 6 | 2019-03-04T15:01:10.000Z | 2022-01-12T23:22:55.000Z | from indicators.Indicator import Indicator
class Ichimoku(Indicator):
def __init__(self, kijunPeriod, tenkanPeriod, chikouLagPeriod, senkouSlowPeriod, senkouLookUpPeriod, timeSeries):
super(Ichimoku, self).__init__()
self.kijunPeriod = kijunPeriod
self.tenkanPeriod = tenkanPeriod
self.chikouLagPeriod = chiko... | 34.093023 | 155 | 0.71487 | from indicators.Indicator import Indicator
class Ichimoku(Indicator):
def __init__(self, kijunPeriod, tenkanPeriod, chikouLagPeriod, senkouSlowPeriod, senkouLookUpPeriod, timeSeries):
super(Ichimoku, self).__init__()
self.kijunPeriod = kijunPeriod
self.tenkanPeriod = tenkanPeriod
self.chikouLagPeriod = chiko... | true | true |
1c2878b7f9f09e04b4ca43ae6819de773725065a | 4,485 | py | Python | test/functional/rpc_net.py | hackverket/bitcoin-abc-bitcore | cc70c0a66b640a1ac59024bac9a314256ed386b2 | [
"MIT"
] | 78 | 2018-07-16T14:55:15.000Z | 2022-02-26T10:43:23.000Z | test/functional/rpc_net.py | hackverket/bitcoin-abc-bitcore | cc70c0a66b640a1ac59024bac9a314256ed386b2 | [
"MIT"
] | 14 | 2018-07-20T02:17:45.000Z | 2019-05-13T09:50:13.000Z | test/functional/rpc_net.py | hackverket/bitcoin-abc-bitcore | cc70c0a66b640a1ac59024bac9a314256ed386b2 | [
"MIT"
] | 28 | 2018-07-17T01:50:37.000Z | 2021-11-04T08:04:56.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
from decimal import Decimal
f... | 42.311321 | 88 | 0.649275 |
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
connect_nodes_bi,
p2p_port,
wait_until,
)
class NetTest(BitcoinTestFramework):
def set_test_params(self):
self.setup... | true | true |
1c287932dd063408f60bc519d0f1ed1176a81c49 | 8,069 | py | Python | aio_marantz_avr/avr.py | silvester747/aio_marantz_avr | 1a8e8f904af3e8c46f9595fa4d714c17ad295572 | [
"MIT"
] | null | null | null | aio_marantz_avr/avr.py | silvester747/aio_marantz_avr | 1a8e8f904af3e8c46f9595fa4d714c17ad295572 | [
"MIT"
] | 1 | 2020-07-16T13:04:45.000Z | 2020-07-16T13:04:45.000Z | aio_marantz_avr/avr.py | silvester747/aio_marantz_avr | 1a8e8f904af3e8c46f9595fa4d714c17ad295572 | [
"MIT"
] | null | null | null | """Control of an AVR over Telnet."""
import asyncio
import telnetlib3
from typing import Any, List, MutableMapping, Optional, Type
from .enums import InputSource, Power, SurroundMode
class AvrError(Exception):
"""Base class for all errors returned from an AVR."""
pass
class DisconnectedError(AvrError):
... | 29.996283 | 95 | 0.614946 |
import asyncio
import telnetlib3
from typing import Any, List, MutableMapping, Optional, Type
from .enums import InputSource, Power, SurroundMode
class AvrError(Exception):
pass
class DisconnectedError(AvrError):
pass
class AvrTimeoutError(AvrError):
pass
async def connect(host: str, port: int... | true | true |
1c287b8fbff673ba57c0365f07c9d1733f25be31 | 1,069 | py | Python | Desafio3_Pandemia/app/Controller/controller_map.py | Renanrbsc/PadawanTemploPython | fb8440e372b7c3fb4624549486c76124c20ef212 | [
"MIT"
] | null | null | null | Desafio3_Pandemia/app/Controller/controller_map.py | Renanrbsc/PadawanTemploPython | fb8440e372b7c3fb4624549486c76124c20ef212 | [
"MIT"
] | null | null | null | Desafio3_Pandemia/app/Controller/controller_map.py | Renanrbsc/PadawanTemploPython | fb8440e372b7c3fb4624549486c76124c20ef212 | [
"MIT"
] | null | null | null | from Desafio3_Pandemia.app.Model.model_function import BaseFunction
from Desafio3_Pandemia.app.Model.model_map import Map
from Desafio3_Pandemia.app.Views.view_terminal import Terminal
class CtrlMap:
def __init__(self):
self._function = BaseFunction()
self._model = Map()
self._view = Termi... | 32.393939 | 67 | 0.719364 | from Desafio3_Pandemia.app.Model.model_function import BaseFunction
from Desafio3_Pandemia.app.Model.model_map import Map
from Desafio3_Pandemia.app.Views.view_terminal import Terminal
class CtrlMap:
def __init__(self):
self._function = BaseFunction()
self._model = Map()
self._view = Termi... | true | true |
1c287db58b9272cc68515d4ef175a1bbdb84e648 | 10,715 | py | Python | classes/game.py | fuji37450/Connect4 | 2277855eff60199b97bcea0c55ce32d1e694b30a | [
"MIT"
] | null | null | null | classes/game.py | fuji37450/Connect4 | 2277855eff60199b97bcea0c55ce32d1e694b30a | [
"MIT"
] | null | null | null | classes/game.py | fuji37450/Connect4 | 2277855eff60199b97bcea0c55ce32d1e694b30a | [
"MIT"
] | null | null | null | import pygame
import random
import time
from classes.player import Player
from classes.board import Board
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
YELLOW = (249, 233, 102)
DARK_YELLOW = (218, 203, 82)
INF = float('inf')
# initialize the column exploration order, starting with center columns
columnOrder ... | 35.716667 | 145 | 0.49734 | import pygame
import random
import time
from classes.player import Player
from classes.board import Board
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
YELLOW = (249, 233, 102)
DARK_YELLOW = (218, 203, 82)
INF = float('inf')
columnOrder = [int(7//2 + (1-2*(i % 2))*(i+1)/2) for i in range(7)]
class GameU... | true | true |
1c287ecb56081284e9955590575cd3528ea79744 | 1,176 | py | Python | pinakes/main/catalog/tests/services/test_finish_order.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | null | null | null | pinakes/main/catalog/tests/services/test_finish_order.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | null | null | null | pinakes/main/catalog/tests/services/test_finish_order.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | null | null | null | """ Test starting an order """
import pytest
from pinakes.main.approval.tests.factories import (
RequestFactory,
)
from pinakes.main.catalog.models import (
ApprovalRequest,
Order,
ProgressMessage,
)
from pinakes.main.catalog.services.finish_order import (
FinishOrder,
)
from pinakes.main.catalog... | 24 | 86 | 0.701531 |
import pytest
from pinakes.main.approval.tests.factories import (
RequestFactory,
)
from pinakes.main.catalog.models import (
ApprovalRequest,
Order,
ProgressMessage,
)
from pinakes.main.catalog.services.finish_order import (
FinishOrder,
)
from pinakes.main.catalog.tests.factories import (
A... | true | true |
1c287ed548f78b76fa472f88f72e0248039f3405 | 2,186 | py | Python | c2cgeoportal/resources.py | pgiraud/c2cgeoportal | 3ec955c5c67d16256af726a62d586b3f4ec3b500 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/resources.py | pgiraud/c2cgeoportal | 3ec955c5c67d16256af726a62d586b3f4ec3b500 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/resources.py | pgiraud/c2cgeoportal | 3ec955c5c67d16256af726a62d586b3f4ec3b500 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# l... | 42.038462 | 81 | 0.76624 |
from pyramid.security import Allow, Authenticated, ALL_PERMISSIONS
from pyramid_formalchemy.resources import Models
class Root(object):
def __init__(self, request):
self.request = request
class FAModels(Models):
__acl__ = [
(Allow, Authenticated, ALL_PERMISSIO... | true | true |
1c287f0dc2a6fc10b21bee8151dd3bfb6fb6b7e3 | 201,423 | py | Python | lib/galaxy/model/__init__.py | openminted/galaxy | bd2147cccf814f8cec93372973b5e6ada4668a80 | [
"CC-BY-3.0"
] | 1 | 2021-04-26T08:46:21.000Z | 2021-04-26T08:46:21.000Z | lib/galaxy/model/__init__.py | openminted/galaxy | bd2147cccf814f8cec93372973b5e6ada4668a80 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/model/__init__.py | openminted/galaxy | bd2147cccf814f8cec93372973b5e6ada4668a80 | [
"CC-BY-3.0"
] | 1 | 2018-12-09T13:50:28.000Z | 2018-12-09T13:50:28.000Z | """
Galaxy data model classes
Naming: try to use class names that have a distinct plural form so that
the relationship cardinalities are obvious (e.g. prefer Dataset to Data)
"""
import codecs
import errno
import json
import logging
import numbers
import operator
import os
import pwd
import socket
import time
from dat... | 37.740866 | 191 | 0.626964 | import codecs
import errno
import json
import logging
import numbers
import operator
import os
import pwd
import socket
import time
from datetime import datetime, timedelta
from string import Template
from uuid import UUID, uuid4
from six import string_types
from sqlalchemy import (and_, func, join, not_, or_, select,... | true | true |
1c287f5beafb861cb37055b91dcfe076efef1db2 | 8,154 | py | Python | test/basic_test.py | codehelp/pkg-pyocd-dfsg | 3a3b417578242454905d4471440ccc16fb19c955 | [
"Apache-2.0"
] | null | null | null | test/basic_test.py | codehelp/pkg-pyocd-dfsg | 3a3b417578242454905d4471440ccc16fb19c955 | [
"Apache-2.0"
] | 1 | 2018-12-27T03:21:06.000Z | 2018-12-27T03:21:06.000Z | test/basic_test.py | codehelp/pkg-pyocd-dfsg | 3a3b417578242454905d4471440ccc16fb19c955 | [
"Apache-2.0"
] | null | null | null | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | 35.606987 | 130 | 0.59897 | from __future__ import print_function
import argparse, os, sys
from time import sleep
from random import randrange
import math
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
from pyocd.core.helpers import ConnectHelper
from pyocd.utility.conversion import float3... | true | true |
1c28800aa8fd3f470e9583b0d8c0795acbebf369 | 1,578 | py | Python | goldcoin/timelord/iters_from_block.py | DevMau5x/goldcoin-blockchain-2 | ed223dd16fa290ea710db7202d6c52a056242cfa | [
"Apache-2.0"
] | 17 | 2021-09-08T17:07:54.000Z | 2022-03-30T04:11:58.000Z | goldcoin/timelord/iters_from_block.py | DevMau5x/goldcoin-blockchain-2 | ed223dd16fa290ea710db7202d6c52a056242cfa | [
"Apache-2.0"
] | 15 | 2021-09-28T21:09:49.000Z | 2022-03-22T21:13:23.000Z | goldcoin/timelord/iters_from_block.py | Pierre21dd/gold2 | 4a35f207ed4c8a7745bfbc73fd3c190bd8b60a3f | [
"Apache-2.0"
] | 9 | 2021-09-12T10:03:23.000Z | 2022-03-15T08:35:11.000Z | from typing import Optional, Tuple, Union
from goldcoin.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters
from goldcoin.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished
from goldcoin.types.blockchain_format.sized_bytes imp... | 35.863636 | 114 | 0.749683 | from typing import Optional, Tuple, Union
from goldcoin.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters
from goldcoin.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished
from goldcoin.types.blockchain_format.sized_bytes imp... | true | true |
1c2882201c3bfc0909f7476a21ae774c713e688e | 1,282 | py | Python | pirates/leveleditor/worldData/Vegas.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/leveleditor/worldData/Vegas.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/leveleditor/worldData/Vegas.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import Point3, VBase3
objectStruct = {'Objects': {'1149705528.16Shochet': {'Type': 'Region','Name': 'default','Objects': {'1149705583.09Shochet': {'Type': 'Island','Name': 'Vegas','File': 'VegasIsland','Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(-410.0, 80.0, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),... | 641 | 1,235 | 0.651326 | from pandac.PandaModules import Point3, VBase3
objectStruct = {'Objects': {'1149705528.16Shochet': {'Type': 'Region','Name': 'default','Objects': {'1149705583.09Shochet': {'Type': 'Island','Name': 'Vegas','File': 'VegasIsland','Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(-410.0, 80.0, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),... | true | true |
1c28841799f65605d802198c0120d9efb186d689 | 7,878 | py | Python | derivations/scripts/sympy_addons.py | arghdos/SPyJac-paper | 7f65253a3acd3a93141e673c2cdd5810ecc6a0ca | [
"CC-BY-4.0"
] | 1 | 2020-10-31T23:56:50.000Z | 2020-10-31T23:56:50.000Z | derivations/scripts/sympy_addons.py | arghdos/SPyJac-paper | 7f65253a3acd3a93141e673c2cdd5810ecc6a0ca | [
"CC-BY-4.0"
] | null | null | null | derivations/scripts/sympy_addons.py | arghdos/SPyJac-paper | 7f65253a3acd3a93141e673c2cdd5810ecc6a0ca | [
"CC-BY-4.0"
] | null | null | null | from sympy.core.symbol import Symbol
from sympy.tensor.indexed import Idx, IndexedBase, Indexed
from sympy.concrete import Product
from sympy.core.compatibility import is_sequence
from sympy.core.singleton import S
from sympy.core.add import Add
from sympy.core.function import Derivative
from sympy.functions.special.te... | 36.64186 | 96 | 0.524879 | from sympy.core.symbol import Symbol
from sympy.tensor.indexed import Idx, IndexedBase, Indexed
from sympy.concrete import Product
from sympy.core.compatibility import is_sequence
from sympy.core.singleton import S
from sympy.core.add import Add
from sympy.core.function import Derivative
from sympy.functions.special.te... | true | true |
1c288563d75f26a17c351e500640dea85029b467 | 96 | py | Python | env/lib/python3.6/bisect.py | quantumleeps/data-collection | 0ecb42c8cd2825f18b3896787e1f609c49798c91 | [
"MIT"
] | null | null | null | env/lib/python3.6/bisect.py | quantumleeps/data-collection | 0ecb42c8cd2825f18b3896787e1f609c49798c91 | [
"MIT"
] | 11 | 2018-01-29T16:26:16.000Z | 2018-04-20T16:06:36.000Z | env/lib/python3.6/bisect.py | quantumleeps/data-collection | 0ecb42c8cd2825f18b3896787e1f609c49798c91 | [
"MIT"
] | 1 | 2019-08-22T23:41:28.000Z | 2019-08-22T23:41:28.000Z | /usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/bisect.py | 96 | 96 | 0.8125 | /usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/bisect.py | false | true |
1c28879b2be6611ffcbbc85ef658930de5c3c361 | 2,658 | py | Python | tests/generate_topo/vegetation/test_landfire_140.py | USDA-ARS-NWRC/basin_setup | 8a9f661ab7897d63dda6c470cfd24f498e6e6183 | [
"CC0-1.0"
] | 1 | 2020-10-15T00:53:46.000Z | 2020-10-15T00:53:46.000Z | tests/generate_topo/vegetation/test_landfire_140.py | USDA-ARS-NWRC/basin_setup | 8a9f661ab7897d63dda6c470cfd24f498e6e6183 | [
"CC0-1.0"
] | 58 | 2017-12-13T23:37:12.000Z | 2021-07-26T19:58:05.000Z | tests/generate_topo/vegetation/test_landfire_140.py | USDA-ARS-NWRC/basin_setup | 8a9f661ab7897d63dda6c470cfd24f498e6e6183 | [
"CC0-1.0"
] | null | null | null | import os
from unittest.mock import patch
import xarray as xr
from basin_setup.generate_topo.vegetation import Landfire140
from basin_setup.utils import domain_extent
from tests.Lakes.lakes_test_case import BasinSetupLakes
# patch the landfire datasets for testing. Comment out to test with the
# real thing
@patch.o... | 35.44 | 75 | 0.688488 | import os
from unittest.mock import patch
import xarray as xr
from basin_setup.generate_topo.vegetation import Landfire140
from basin_setup.utils import domain_extent
from tests.Lakes.lakes_test_case import BasinSetupLakes
@patch.object(Landfire140, 'veg_height_csv',
new='tests/Lakes/data/landfire_1... | true | true |
1c2887ad47e81c877b5ee12f1fd14f58410afb2c | 566 | py | Python | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/tests/cudadrv/test_profiler.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/tests/cudadrv/test_profiler.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/tests/cudadrv/test_profiler.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | from __future__ import absolute_import, print_function
import numba.unittest_support as unittest
from numba.cuda.testing import CUDATestCase
from numba import cuda
from numba.cuda.testing import skip_on_cudasim
@skip_on_cudasim('CUDA Profiler unsupported in the simulator')
class TestProfiler(CUDATestCase):
def te... | 24.608696 | 62 | 0.701413 | from __future__ import absolute_import, print_function
import numba.unittest_support as unittest
from numba.cuda.testing import CUDATestCase
from numba import cuda
from numba.cuda.testing import skip_on_cudasim
@skip_on_cudasim('CUDA Profiler unsupported in the simulator')
class TestProfiler(CUDATestCase):
def te... | true | true |
1c28883d9a0ad49328e03b43a80900d026a47663 | 2,224 | py | Python | plaso/output/pstorage.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | 3 | 2016-03-11T02:47:08.000Z | 2016-12-24T03:19:27.000Z | plaso/output/pstorage.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | plaso/output/pstorage.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | 34.75 | 78 | 0.717626 |
from plaso.lib import event
from plaso.lib import output
from plaso.lib import storage
from plaso.lib import timelib
class Pstorage(output.LogOutputFormatter):
def Start(self):
pre_obj = event.PreprocessObject()
pre_obj.collection_information = {}
pre_obj.collection_information['time_... | true | true |
1c28884fc21a1760ba336f8ad108afb2623aa54f | 8,139 | py | Python | sdk/lusid_asyncio/models/paged_resource_list_of_participation.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/paged_resource_list_of_participation.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/paged_resource_list_of_participation.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3923
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 30.483146 | 140 | 0.606954 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re
import six
from lusid_asyncio.configuration import Configuration
class PagedResourceListOfParticipation(object):
openapi_types = {
'next_page': 'str',
... | true | true |
1c2888e47062ada268a37cbe0ace3f8c088078b6 | 12,284 | py | Python | lingvo/core/datasource_test.py | zh794390558/lingvo | ecdf678179018ca07f4f52d065b9bf3fe2dc7c5a | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:35.000Z | 2019-10-10T06:08:35.000Z | lingvo/core/datasource_test.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | null | null | null | lingvo/core/datasource_test.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:39.000Z | 2019-10-10T06:08:39.000Z | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 40.013029 | 80 | 0.718903 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import lingvo.compat as tf
from lingvo.core import datasource
from lingvo.core import py_utils
def _MockDataSourceFromFilePattern(file_pattern, input_source_weights=None):
del input_source_... | true | true |
1c2888f41906f218dd3e15a987380e5df48d26e2 | 6,471 | py | Python | tests/test_spectrometers.py | jonathanvanschenck/python-seabreeze | 2756e094b4277e54d454cef748bef2de1278b770 | [
"MIT"
] | null | null | null | tests/test_spectrometers.py | jonathanvanschenck/python-seabreeze | 2756e094b4277e54d454cef748bef2de1278b770 | [
"MIT"
] | null | null | null | tests/test_spectrometers.py | jonathanvanschenck/python-seabreeze | 2756e094b4277e54d454cef748bef2de1278b770 | [
"MIT"
] | null | null | null | import pytest
try:
import seabreeze.pyseabreeze as psb
except ImportError:
psb = None
try:
import seabreeze.cseabreeze as csb
except ImportError:
csb = None
# skip all tests in this module if no backends can be imported
if csb is not None or psb is not None:
import seabreeze
seabreeze.use("... | 29.413636 | 88 | 0.660794 | import pytest
try:
import seabreeze.pyseabreeze as psb
except ImportError:
psb = None
try:
import seabreeze.cseabreeze as csb
except ImportError:
csb = None
if csb is not None or psb is not None:
import seabreeze
seabreeze.use("cseabreeze", force=False)
from seabreeze.spectrometers imp... | true | true |
1c288931938fb6251fd0aa6c38507fc541c98966 | 453,617 | py | Python | modules/s3db/pr.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | null | null | null | modules/s3db/pr.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | null | null | null | modules/s3db/pr.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Sahana Eden Person Registry Model
@copyright: 2009-2021 (c) Sahana Software Foundation
@license: MIT
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 Softwa... | 40.767233 | 252 | 0.415868 |
__all__ = (
"PersonEntityModel",
"PersonModel",
"PersonGroupModel",
"ForumModel",
"PersonEntityRealmModel",
"PersonEntityAddressModel",
"PersonEntityContactModel",
"PersonEntityImageModel",
"PersonEntityNo... | true | true |
1c288b0723ba00d21e86ab031a34ef0f04a4dbe0 | 8,516 | py | Python | experiments/ashvin/rss/pusher1/original/td3bc1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/rss/pusher1/original/td3bc1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/rss/pusher1/original/td3bc1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | """Example behavior cloning script for pointmass.
If you are trying to run this code, ask Ashvin for the demonstration file:
demos/pointmass_demos_100.npy (which should go in your S3 storage)
"""
import railrl.misc.hyperparameter as hyp
from multiworld.envs.mujoco.cameras import sawyer_pusher_camera_upright_v2
from m... | 32.753846 | 87 | 0.629403 |
import railrl.misc.hyperparameter as hyp
from multiworld.envs.mujoco.cameras import sawyer_pusher_camera_upright_v2
from multiworld.envs.pygame.point2d import Point2DWallEnv
from multiworld.envs.mujoco.sawyer_xyz.sawyer_push_multiobj import SawyerMultiobjectEnv
from railrl.launchers.launcher_util import run_experime... | true | true |
1c288d6dc062f019fc3dd65464dffa74d6ee0489 | 4,409 | py | Python | hubblestack/files/hubblestack_nova/vulners_scanner.py | NerdsvilleCEO/hubble | 200dc8bc2075da5753b2424f1597d806a4139d41 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/vulners_scanner.py | NerdsvilleCEO/hubble | 200dc8bc2075da5753b2424f1597d806a4139d41 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/vulners_scanner.py | NerdsvilleCEO/hubble | 200dc8bc2075da5753b2424f1597d806a4139d41 | [
"Apache-2.0"
] | null | null | null | '''
HubbleStack Nova plugin for auditing installed packages.
The module gets the list of installed packages of the system and queries
the Vulners.com Linux Vulnerability Audit API.
The API is described at the link below:
https://blog.vulners.com/linux-vulnerability-audit-in-vulners/
This audit module requires a ... | 31.719424 | 107 | 0.650034 |
from __future__ import absolute_import
import logging
import sys
import requests
log = logging.getLogger(__name__)
def __virtual__():
return not sys.platform.startswith('win')
def audit(data_list, tags, labels, debug=False, **kwargs):
os_name = __grains__.get('os').lower()
os_version = __grains__.ge... | true | true |
1c288e4100d6f8bf44bb2b099e3c910997afe50b | 881 | py | Python | BACKEND/dbsbank/dbsbank/urls.py | cvsnpraveen/VirtualHiring | ded7f3a65e84fb185f19dee400c433fac23e077b | [
"MIT"
] | null | null | null | BACKEND/dbsbank/dbsbank/urls.py | cvsnpraveen/VirtualHiring | ded7f3a65e84fb185f19dee400c433fac23e077b | [
"MIT"
] | null | null | null | BACKEND/dbsbank/dbsbank/urls.py | cvsnpraveen/VirtualHiring | ded7f3a65e84fb185f19dee400c433fac23e077b | [
"MIT"
] | 2 | 2022-01-29T07:06:49.000Z | 2022-01-29T07:47:44.000Z | """dbs URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 33.884615 | 78 | 0.690125 | from django.contrib import admin
from django.urls import path,include
from order import urls
admin.site.site_header="DBS order Booking"
urlpatterns = [
path('admin/', admin.site.urls),
path("",include("order.urls")),
]
| true | true |
1c288f3285db06a192514543fd2e83081e4babdb | 4,003 | py | Python | qiskit_metal/renderers/renderer_base/rndr_analysis.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 167 | 2021-03-17T20:35:17.000Z | 2022-03-31T13:25:04.000Z | qiskit_metal/renderers/renderer_base/rndr_analysis.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 307 | 2021-03-17T14:07:43.000Z | 2022-03-23T14:22:20.000Z | qiskit_metal/renderers/renderer_base/rndr_analysis.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 122 | 2021-03-17T14:21:24.000Z | 2022-03-18T10:09:38.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 28.592857 | 95 | 0.616538 |
from . import QRenderer
from ... import Dict
from abc import abstractmethod, ABC
from ...designs import QDesign, is_design
__all__ = ['QRendererAnalysis']
class QRendererAnalysis(QRenderer):
def __init__(self, design: 'QDesign', initiate=False, options: Dict = None):
super().__init__(desi... | true | true |
1c288f60bb849774cf46d051d8aaed94c2ba7c9b | 6,813 | py | Python | neural_testbed/agents/enn_agent.py | deepmind/neural_testbed | 5b18d74473403fd5dc28c2570a1641b24e9d0a28 | [
"Apache-2.0"
] | 67 | 2021-10-04T09:29:12.000Z | 2022-03-25T11:10:15.000Z | neural_testbed/agents/enn_agent.py | deepmind/neural_testbed | 5b18d74473403fd5dc28c2570a1641b24e9d0a28 | [
"Apache-2.0"
] | 2 | 2021-11-03T10:48:02.000Z | 2021-11-05T11:04:58.000Z | neural_testbed/agents/enn_agent.py | deepmind/neural_testbed | 5b18d74473403fd5dc28c2570a1641b24e9d0a28 | [
"Apache-2.0"
] | 4 | 2021-10-12T23:57:39.000Z | 2022-03-23T04:02:25.000Z | # pylint: disable=g-bad-file-header
# Copyright 2021 DeepMind Technologies Limited. 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/... | 36.239362 | 79 | 0.722002 |
import dataclasses
from typing import Dict, Optional, Union, Callable
from acme.utils import loggers
import chex
from enn import base as enn_base
from enn import supervised
from enn import utils
import jax
from neural_testbed import base as testbed_base
from neural_testbed import likelihood
from neura... | true | true |
1c289099a759e76dc9f87ff5597225983e103848 | 2,161 | py | Python | deepxde/losses.py | HiddeLekanne/deepxde | dbe9188866bc8e4fc472e5d59a82a2202b033ab1 | [
"Apache-2.0"
] | null | null | null | deepxde/losses.py | HiddeLekanne/deepxde | dbe9188866bc8e4fc472e5d59a82a2202b033ab1 | [
"Apache-2.0"
] | null | null | null | deepxde/losses.py | HiddeLekanne/deepxde | dbe9188866bc8e4fc472e5d59a82a2202b033ab1 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import backend as bkd
from . import config
from .backend import tf
def mean_absolute_error(y_true, y_pred):
return tf.keras.losses.MeanAbsoluteError()(y_true, y_pred)
def mean_absolute_percentage... | 33.765625 | 102 | 0.713096 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import backend as bkd
from . import config
from .backend import tf
def mean_absolute_error(y_true, y_pred):
return tf.keras.losses.MeanAbsoluteError()(y_true, y_pred)
def mean_absolute_percentage... | true | true |
1c2891cb7085a890753ff442679c7ef8b55f97e0 | 1,627 | py | Python | lagpy/functools/Environment.py | lagagain/lagpy | c46ee0c72c11b801b6b03980296fe6c739479c46 | [
"BSD-3-Clause"
] | null | null | null | lagpy/functools/Environment.py | lagagain/lagpy | c46ee0c72c11b801b6b03980296fe6c739479c46 | [
"BSD-3-Clause"
] | null | null | null | lagpy/functools/Environment.py | lagagain/lagpy | c46ee0c72c11b801b6b03980296fe6c739479c46 | [
"BSD-3-Clause"
] | null | null | null | from .Callable import CallableWrapper
class Environment:
"""
>>> def puts(s:str, *args, **kwargs):
... print(s, *args, **kwargs)
... return s
>>>
>>> Env = Environment # alias
>>> env = Env()
>>> # env(puts,"Hello", end="") \
>>> # (puts, 'World.') # Output: Hello, World
... | 24.283582 | 79 | 0.519361 | from .Callable import CallableWrapper
class Environment:
def __getitem__(self, key:str):
return self.__getattr__(key)
def __setitem__(self, key:str, value):
setattr(self, key, value)
return CallableWrapper.new(value)
def __getattr__(self, key: str, default = None):
if key ... | true | true |
1c2892fa85cf68d3ffb2104d8116ba4d1540ff1c | 1,187 | py | Python | robot-server/robot_server/protocols/protocol_analyzer.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | 2 | 2015-11-10T17:49:51.000Z | 2016-01-15T04:43:37.000Z | robot-server/robot_server/protocols/protocol_analyzer.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | robot-server/robot_server/protocols/protocol_analyzer.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | """Protocol analysis module."""
import logging
from opentrons.protocol_runner import ProtocolRunner
from .protocol_store import ProtocolResource
from .analysis_store import AnalysisStore
log = logging.getLogger(__name__)
class ProtocolAnalyzer:
"""A collaborator to perform an analysis of a protocol and store ... | 28.261905 | 83 | 0.672283 | import logging
from opentrons.protocol_runner import ProtocolRunner
from .protocol_store import ProtocolResource
from .analysis_store import AnalysisStore
log = logging.getLogger(__name__)
class ProtocolAnalyzer:
def __init__(
self,
protocol_runner: ProtocolRunner,
analysis_store: Ana... | true | true |
1c2893a14cba5023fe0cc349c0da3693597e8075 | 703 | py | Python | user/api/dev/serializers.py | dermrsimon/wopi-engine | 934a238b98f7e1f479a358776eb396f5d6bc0f24 | [
"BSD-Source-Code"
] | null | null | null | user/api/dev/serializers.py | dermrsimon/wopi-engine | 934a238b98f7e1f479a358776eb396f5d6bc0f24 | [
"BSD-Source-Code"
] | null | null | null | user/api/dev/serializers.py | dermrsimon/wopi-engine | 934a238b98f7e1f479a358776eb396f5d6bc0f24 | [
"BSD-Source-Code"
] | null | null | null | #
# Created on Mon Nov 02 2020
#
# Copyright (c) 2020 - Simon Prast
#
from rest_framework import serializers
from user.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
exclude = ['password', 'is_admin']
class RegisterUserSerializer(serializers.Mod... | 21.96875 | 58 | 0.648649 |
from rest_framework import serializers
from user.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
exclude = ['password', 'is_admin']
class RegisterUserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | true | true |
1c2894ee68717c322e27f9f0050efea9f6e5bfd5 | 1,346 | py | Python | adv_2017/day2_checksum.py | vschule/adventcode | 273698fd8bc88beec6b707a87d3b956594493792 | [
"MIT"
] | null | null | null | adv_2017/day2_checksum.py | vschule/adventcode | 273698fd8bc88beec6b707a87d3b956594493792 | [
"MIT"
] | null | null | null | adv_2017/day2_checksum.py | vschule/adventcode | 273698fd8bc88beec6b707a87d3b956594493792 | [
"MIT"
] | null | null | null | import pytest
def first(lines):
summed = 0
for line in lines.splitlines():
values = list(map(int, line.split()))
maximum = max(values)
minimum = min(values)
summed += maximum - minimum
return summed
def second(lines):
output_cs = 0
for line in lines.splitlines()... | 21.709677 | 53 | 0.502972 | import pytest
def first(lines):
summed = 0
for line in lines.splitlines():
values = list(map(int, line.split()))
maximum = max(values)
minimum = min(values)
summed += maximum - minimum
return summed
def second(lines):
output_cs = 0
for line in lines.splitlines()... | true | true |
1c289568b0b844064557a4acd8495b60c4ca009e | 8,660 | py | Python | tests/002_finder/101_compilable.py | Sam-prog-sudo/boussole | 5d6ec94356f9a91ff4d6d23c1700d3512b67006a | [
"MIT"
] | 13 | 2016-05-19T15:18:41.000Z | 2022-03-22T15:37:32.000Z | tests/002_finder/101_compilable.py | Sam-prog-sudo/boussole | 5d6ec94356f9a91ff4d6d23c1700d3512b67006a | [
"MIT"
] | 38 | 2016-04-07T00:30:58.000Z | 2022-02-28T13:29:33.000Z | tests/002_finder/101_compilable.py | Sam-prog-sudo/boussole | 5d6ec94356f9a91ff4d6d23c1700d3512b67006a | [
"MIT"
] | 3 | 2016-05-20T09:21:57.000Z | 2020-10-12T10:56:49.000Z | # -*- coding: utf-8 -*-
import os
def test_relative_nonrecursive_001(settings, finder):
"""
Find non recursively all compilable sources from sample project in relative
mode
"""
result = finder.compilable_sources(
settings.sample_path,
recursive=False
)
assert result == [
... | 34.501992 | 79 | 0.655312 |
import os
def test_relative_nonrecursive_001(settings, finder):
result = finder.compilable_sources(
settings.sample_path,
recursive=False
)
assert result == [
"main_basic.scss",
"main_circular_0.scss",
"main_circular_1.scss",
"main_circular_2.scss",
... | true | true |
1c2897a20bf18a17eb70e73495b2ded76270d61f | 16,201 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/net_tools/haproxy.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | venv/lib/python2.7/site-packages/ansible/modules/net_tools/haproxy.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | venv/lib/python2.7/site-packages/ansible/modules/net_tools/haproxy.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ravi Bhure <ravibhure@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 36.002222 | 139 | 0.644034 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: haproxy
version_added: "1.9"
short_description: Enabl... | true | true |
1c28998789ef432ebc696ee0ae0ec8145d931f04 | 20,477 | py | Python | nipyapi/nifi/apis/input_ports_api.py | Zyrix/nipyapi | d00221ba50bd83e21133d6e4d4b56741ead6822a | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/apis/input_ports_api.py | Zyrix/nipyapi | d00221ba50bd83e21133d6e4d4b56741ead6822a | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/apis/input_ports_api.py | Zyrix/nipyapi | d00221ba50bd83e21133d6e4d4b56741ead6822a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 41.619919 | 479 | 0.568882 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class InputPortsApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
1c289a4c95011eb37f9f21b88f1792732ffbacf0 | 3,167 | py | Python | filepath/constants.py | Cediner/Rise-of-Kingdoms-Bot | 784de31bfa1d505abe20f147bc32ed4638d2bc93 | [
"MIT"
] | 2 | 2022-02-03T14:50:57.000Z | 2022-02-03T19:46:23.000Z | filepath/constants.py | Cediner/Rise-of-Kingdoms-Bot | 784de31bfa1d505abe20f147bc32ed4638d2bc93 | [
"MIT"
] | 1 | 2022-02-03T17:12:18.000Z | 2022-02-04T03:51:30.000Z | filepath/constants.py | Cediner/Rise-of-Kingdoms-Bot | 784de31bfa1d505abe20f147bc32ed4638d2bc93 | [
"MIT"
] | 4 | 2022-02-03T14:51:00.000Z | 2022-02-23T09:44:46.000Z | RESOURCES = 'RESOURCES'
SPEEDUPS = 'SPEEDUPS'
BOOSTS = 'BOOSTS'
EQUIPMENT = 'EQUIPMENT'
OTHER = 'OTHER'
HOME = 'HOME'
MAP = 'MAP'
GREEN_HOME = 'GREEN_HOME'
WINDOW = 'WINDOW'
WINDOW_TITLE = 'WINDOW_TITLE'
BUILDING_TITLE = 'BUILDING_TITLE'
BUILDING_INFO = 'BUILDING_INFO'
MENU_OPENED_IMAGE = 'MENU_OPENED_IMAGE'
MENU_IMAGE... | 34.053763 | 67 | 0.825703 | RESOURCES = 'RESOURCES'
SPEEDUPS = 'SPEEDUPS'
BOOSTS = 'BOOSTS'
EQUIPMENT = 'EQUIPMENT'
OTHER = 'OTHER'
HOME = 'HOME'
MAP = 'MAP'
GREEN_HOME = 'GREEN_HOME'
WINDOW = 'WINDOW'
WINDOW_TITLE = 'WINDOW_TITLE'
BUILDING_TITLE = 'BUILDING_TITLE'
BUILDING_INFO = 'BUILDING_INFO'
MENU_OPENED_IMAGE = 'MENU_OPENED_IMAGE'
MENU_IMAGE... | true | true |
1c289af90daa61a2f2b7e9320d353df5c845d4ae | 464 | py | Python | My first python project.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | My first python project.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | My first python project.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | 1 | 2020-09-30T18:53:05.000Z | 2020-09-30T18:53:05.000Z | print("hello freinds i am first python program of Tanmay")
print("so first i will find avg of a number you give me")
a = input("Enter first number : ")
b = input("Enter second number : ")
a = int(a)
b = int(b)
avg = (a + b)/2
print("the average of your number is",avg)
print("Now i will square the number you... | 24.421053 | 59 | 0.637931 | print("hello freinds i am first python program of Tanmay")
print("so first i will find avg of a number you give me")
a = input("Enter first number : ")
b = input("Enter second number : ")
a = int(a)
b = int(b)
avg = (a + b)/2
print("the average of your number is",avg)
print("Now i will square the number you... | true | true |
1c289bc56ab75b46d6187d02df0b140d7b9e52f2 | 1,635 | py | Python | src/apps/api/errors.py | Chise1/fast-tmp2 | 0dd34ac3ec7ea5452c1e4b8d922a40665264f42b | [
"Apache-2.0"
] | 1 | 2021-07-02T09:14:12.000Z | 2021-07-02T09:14:12.000Z | src/apps/api/errors.py | Chise1/fast-tmp2 | 0dd34ac3ec7ea5452c1e4b8d922a40665264f42b | [
"Apache-2.0"
] | null | null | null | src/apps/api/errors.py | Chise1/fast-tmp2 | 0dd34ac3ec7ea5452c1e4b8d922a40665264f42b | [
"Apache-2.0"
] | null | null | null | from pydantic import BaseModel
class BaseError(BaseModel):
error: int
msg: str
class EntityNotFound(BaseError):
error = 1
msg = "实体未找到"
class UserBaned(BaseError):
error = 2
msg = "你的账号已被冻结"
class EntityExists(BaseError):
error = 3
msg = "实体已存在"
class VerifyCodeError(BaseError)... | 13.401639 | 37 | 0.633639 | from pydantic import BaseModel
class BaseError(BaseModel):
error: int
msg: str
class EntityNotFound(BaseError):
error = 1
msg = "实体未找到"
class UserBaned(BaseError):
error = 2
msg = "你的账号已被冻结"
class EntityExists(BaseError):
error = 3
msg = "实体已存在"
class VerifyCodeError(BaseError)... | true | true |
1c289cb87d2aa6c9f4dd04e764e10063663c4994 | 1,654 | py | Python | main.py | zerv-bot/gitafe | 9637808d39b9eb828a839d1273155fdb26c0c6fa | [
"MIT"
] | null | null | null | main.py | zerv-bot/gitafe | 9637808d39b9eb828a839d1273155fdb26c0c6fa | [
"MIT"
] | null | null | null | main.py | zerv-bot/gitafe | 9637808d39b9eb828a839d1273155fdb26c0c6fa | [
"MIT"
] | null | null | null | # GITAFE - Time is money.
# Author : Harvey Wu
import os
import sys
import yaml
VERSION = '0.1'
CONFIG_VERSION = '0.0'
CONFIG_PATH = 'config.yaml'
GIT_BRANCH = 'main'
def main():
try:
with open(CONFIG_PATH, 'r') as f:
data = yaml.safe_load(f)
CONFIG_VERSION = str(data.get('version... | 33.755102 | 95 | 0.542322 |
import os
import sys
import yaml
VERSION = '0.1'
CONFIG_VERSION = '0.0'
CONFIG_PATH = 'config.yaml'
GIT_BRANCH = 'main'
def main():
try:
with open(CONFIG_PATH, 'r') as f:
data = yaml.safe_load(f)
CONFIG_VERSION = str(data.get('version'))
GIT_BRANCH = str(data.get('br... | true | true |
1c289d697b2ddba1cb7fb4186a099cf8a31f0198 | 670 | py | Python | manage.py | ttppren-github/MeetingSample-Backend | 7ed01498d1c825333c496b41450140e2438cd630 | [
"MIT"
] | 7 | 2021-11-11T09:29:20.000Z | 2021-11-15T03:45:22.000Z | manage.py | ttppren-github/MeetingSample-Backend | 7ed01498d1c825333c496b41450140e2438cd630 | [
"MIT"
] | null | null | null | manage.py | ttppren-github/MeetingSample-Backend | 7ed01498d1c825333c496b41450140e2438cd630 | [
"MIT"
] | 4 | 2021-11-12T03:32:02.000Z | 2021-11-15T03:45:24.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meeting_sample.settings')
try:
from django.core.management import execute_from_command_line
exce... | 29.130435 | 78 | 0.68209 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meeting_sample.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and ... | true | true |
1c289e711882426f4c3fbddefd2a9a728bdd18c0 | 4,342 | py | Python | src/etc/make-win-dist.py | wickerwaka/rust | 140e79385494da83f5a36f8fefa001b2180fa541 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2016-12-02T22:31:57.000Z | 2022-03-14T19:54:37.000Z | src/etc/make-win-dist.py | wickerwaka/rust | 140e79385494da83f5a36f8fefa001b2180fa541 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | src/etc/make-win-dist.py | wickerwaka/rust | 140e79385494da83f5a36f8fefa001b2180fa541 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2017-06-08T10:09:37.000Z | 2017-06-08T10:09:37.000Z | # Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or ht... | 34.736 | 89 | 0.538922 |
import sys
import os
import shutil
import subprocess
def find_files(files, path):
found = []
for fname in files:
for dir in path:
filepath = os.path.normpath(os.path.join(dir, fname))
if os.path.isfile(filepath):
found.append(filepath)
... | true | true |
1c289fbc39239579ee145ec6aed31fe56fa7f614 | 8,530 | py | Python | networks/networks.py | Ch4nYH/dataset-distillation | 61effcfe8aa7a1a3d9f66ece1fa29bcb393472c2 | [
"MIT"
] | null | null | null | networks/networks.py | Ch4nYH/dataset-distillation | 61effcfe8aa7a1a3d9f66ece1fa29bcb393472c2 | [
"MIT"
] | null | null | null | networks/networks.py | Ch4nYH/dataset-distillation | 61effcfe8aa7a1a3d9f66ece1fa29bcb393472c2 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
from . import utils
class LeNet(utils.ReparamModule):
supported_dims = {28, 32}
def __init__(self, state):
if state.dropout:
raise ValueError("LeNet doesn't support dropout")
super(LeNet, self).__init__()
self.conv1 = ... | 38.251121 | 118 | 0.601172 | import torch.nn as nn
import torch.nn.functional as F
from . import utils
class LeNet(utils.ReparamModule):
supported_dims = {28, 32}
def __init__(self, state):
if state.dropout:
raise ValueError("LeNet doesn't support dropout")
super(LeNet, self).__init__()
self.conv1 = ... | true | true |
1c289fcebddf5fc23e3935526c0b81f2db1e1901 | 19,632 | py | Python | dee/dee_task.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 15 | 2020-08-27T11:31:04.000Z | 2022-03-07T03:14:21.000Z | dee/dee_task.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 1 | 2020-08-24T07:56:38.000Z | 2022-03-18T01:26:57.000Z | dee/dee_task.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 2 | 2020-12-03T09:09:54.000Z | 2021-05-20T06:15:29.000Z | # -*- coding: utf-8 -*-
# AUTHOR: Shun Zheng
# DATE: 19-9-19
import logging
import os
import torch.optim as optim
import torch.distributed as dist
from itertools import product
from .dee_helper import logger, DEEExample, DEEExampleLoader, DEEFeatureConverter, \
convert_dee_features_to_dataset, prepare_doc_batch_d... | 43.626667 | 120 | 0.639925 |
import logging
import os
import torch.optim as optim
import torch.distributed as dist
from itertools import product
from .dee_helper import logger, DEEExample, DEEExampleLoader, DEEFeatureConverter, \
convert_dee_features_to_dataset, prepare_doc_batch_dict, measure_dee_prediction, \
decode_dump_template, e... | true | true |
1c289ff869d5f785ab60187b647ccc2ca1e7de1e | 13,562 | py | Python | bot/cogs/misc.py | AvocadoManYT/Test | 06728cb852e675c86fbcf687780fc7bff88b8a43 | [
"MIT"
] | null | null | null | bot/cogs/misc.py | AvocadoManYT/Test | 06728cb852e675c86fbcf687780fc7bff88b8a43 | [
"MIT"
] | null | null | null | bot/cogs/misc.py | AvocadoManYT/Test | 06728cb852e675c86fbcf687780fc7bff88b8a43 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from main import restart_reason as rr, owners, note
import datetime
import json
import DiscordUtils
from datetime import datetime
from discord.ext.commands import Cog as c, command as cmd
class Miscellaneous(commands.Cog):
""" Cog for miscellaneous commands"""
a... | 45.972881 | 313 | 0.596077 | import discord
from discord.ext import commands
from main import restart_reason as rr, owners, note
import datetime
import json
import DiscordUtils
from datetime import datetime
from discord.ext.commands import Cog as c, command as cmd
class Miscellaneous(commands.Cog):
async def open_accoun(self, user):
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.