max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
cartoonify.py | adl1995/image-processing-filters | 0 | 10700 | <filename>cartoonify.py
#!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
import matplotlib.pyplot as plt
import numpy as np
import skimage as ski
import Image
def cartoonify(im, display=False):
"""
function receives an image and add its gradient magnitude in it and add i... | <filename>cartoonify.py
#!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
import matplotlib.pyplot as plt
import numpy as np
import skimage as ski
import Image
def cartoonify(im, display=False):
"""
function receives an image and add its gradient magnitude in it and add i... | en | 0.686938 | #!/usr/bin/env python function receives an image and add its gradient magnitude in it and add it to the original image to return a semi-cartoon image. Note: You will have to scale the gradient-magnitue image before adding it back to the input image. Input: im: input image to cartoonify display: whe... | 3.821585 | 4 |
keymapper/__init__.py | rburns629/KeyMapper | 0 | 10701 | from dataclasses import dataclass
import json
import re
@dataclass
class KeyMapper(dict):
"""
Example:
km = KeyMapper({'messages': {'message1': 'Hello World!'}}})
print(km['messages.message1'])
Variables:
__delimiter__ is set to dot-notation by default, unless specified otherwise.
... | from dataclasses import dataclass
import json
import re
@dataclass
class KeyMapper(dict):
"""
Example:
km = KeyMapper({'messages': {'message1': 'Hello World!'}}})
print(km['messages.message1'])
Variables:
__delimiter__ is set to dot-notation by default, unless specified otherwise.
... | en | 0.308857 | Example: km = KeyMapper({'messages': {'message1': 'Hello World!'}}}) print(km['messages.message1']) Variables: __delimiter__ is set to dot-notation by default, unless specified otherwise. # Default | 3.230306 | 3 |
PythonFiles_DataScience/demo37_pythonfordatascience.py | mahnooranjum/Programming_DataScience | 0 | 10702 | # -*- coding: utf-8 -*-
"""Demo37_PythonforDataScience.ipynb
# PYTHON FOR DATA SCIENCE
We will take our python programming skills a step further and process large data in it. Python is an excellent language for deployment. Hence we will be using open source data during the learning process!!
This will make sure we un... | # -*- coding: utf-8 -*-
"""Demo37_PythonforDataScience.ipynb
# PYTHON FOR DATA SCIENCE
We will take our python programming skills a step further and process large data in it. Python is an excellent language for deployment. Hence we will be using open source data during the learning process!!
This will make sure we un... | en | 0.844136 | # -*- coding: utf-8 -*- Demo37_PythonforDataScience.ipynb # PYTHON FOR DATA SCIENCE We will take our python programming skills a step further and process large data in it. Python is an excellent language for deployment. Hence we will be using open source data during the learning process!! This will make sure we under... | 4.178516 | 4 |
quantrocket/db.py | Jay-Jay-D/quantrocket-client | 0 | 10703 | <gh_stars>0
# Copyright 2017 QuantRocket - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | # Copyright 2017 QuantRocket - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | en | 0.658561 | # Copyright 2017 QuantRocket - All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ... | 2.589906 | 3 |
ink2canvas/GradientHelper.py | greipfrut/pdftohtml5canvas | 4 | 10704 | <filename>ink2canvas/GradientHelper.py
from ink2canvas.lib.simpletransform import parseTransform
class GradientHelper(object):
def __init__(self, abstractShape):
self.abstractShape = abstractShape
def hasGradient(self, key):
style = self.abstractShape.getStyle()
if ... | <filename>ink2canvas/GradientHelper.py
from ink2canvas.lib.simpletransform import parseTransform
class GradientHelper(object):
def __init__(self, abstractShape):
self.abstractShape = abstractShape
def hasGradient(self, key):
style = self.abstractShape.getStyle()
if ... | es | 0.584595 | #linear"): #radial"): | 3.014201 | 3 |
project/manage.py | yosukesuzuki/let-me-notify | 0 | 10705 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Kay management script.
:Copyright: (c) 2009 Accense Technology, Inc. All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import logging
sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
import kay
kay.setup_en... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Kay management script.
:Copyright: (c) 2009 Accense Technology, Inc. All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import logging
sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
import kay
kay.setup_en... | en | 0.752953 | #!/usr/bin/env python # -*- coding: utf-8 -*- Kay management script. :Copyright: (c) 2009 Accense Technology, Inc. All rights reserved. :license: BSD, see LICENSE for more details. | 1.788718 | 2 |
examples/plotting/field_pole_figure.py | heprom/pymicro | 30 | 10706 | <reponame>heprom/pymicro<filename>examples/plotting/field_pole_figure.py
from pymicro.crystal.microstructure import *
from pymicro.crystal.texture import *
from pymicro.examples import PYMICRO_EXAMPLES_DATA_DIR
from matplotlib import pyplot as plt, colors, colorbar, cm
import pathlib as pl
'''This example demonstrat... | from pymicro.crystal.microstructure import *
from pymicro.crystal.texture import *
from pymicro.examples import PYMICRO_EXAMPLES_DATA_DIR
from matplotlib import pyplot as plt, colors, colorbar, cm
import pathlib as pl
'''This example demonstrate how a field can be used to color each symbol on
the pole figure with th... | en | 0.499085 | This example demonstrate how a field can be used to color each symbol on the pole figure with the :py:meth:~`pymicro.crystal.texture.set_map_field` method. #orientations = Orientation.read_euler_txt('../data/orientation_set.inp') #for i in range(600): # micro.grains.append(Grain(i, orientations[i + 1])) # load strai... | 2.671744 | 3 |
model/img2seq_torch.py | marcoleewow/LaTeX_OCR | 290 | 10707 | <gh_stars>100-1000
import time
import sys
import os
import numpy as np
import torch
import torch.nn as nn
import torchvision.models as models
from torch.nn.utils.rnn import pack_padded_sequence
from model.base_torch import BaseModel
from model.utils.general import init_dir, get_logger
from model.utils.g... | import time
import sys
import os
import numpy as np
import torch
import torch.nn as nn
import torchvision.models as models
from torch.nn.utils.rnn import pack_padded_sequence
from model.base_torch import BaseModel
from model.utils.general import init_dir, get_logger
from model.utils.general import Progb... | en | 0.702969 | A PyTorch Dataset class to be used in a PyTorch DataLoader to create batches. :param data_folder: folder where data files are stored
:param data_name: base name of processed datasets
:param split: split, one of 'TRAIN', 'VAL', or 'TEST'
:param transform: image transform pipeline # PyTorch tra... | 2.211241 | 2 |
src/third_party/dart/tools/dom/scripts/all_tests.py | rhencke/engine | 21 | 10708 | #!/usr/bin/python
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""This entry point runs all script tests."""
import logging.config
import unittest
if ... | #!/usr/bin/python
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""This entry point runs all script tests."""
import logging.config
import unittest
if ... | en | 0.886715 | #!/usr/bin/python # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. This entry point runs all script tests. | 2.036107 | 2 |
src/11/11367.py | youngdaLee/Baekjoon | 11 | 10709 | <filename>src/11/11367.py
"""
11367. Report Card Time
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 64 ms
해결 날짜: 2020년 9월 18일
"""
def main():
for _ in range(int(input())):
name, score = input().split()
score = int(score)
if score < 60: grade = 'F'
elif score < 67: grade = 'D... | <filename>src/11/11367.py
"""
11367. Report Card Time
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 64 ms
해결 날짜: 2020년 9월 18일
"""
def main():
for _ in range(int(input())):
name, score = input().split()
score = int(score)
if score < 60: grade = 'F'
elif score < 67: grade = 'D... | ko | 0.995778 | 11367. Report Card Time 작성자: xCrypt0r 언어: Python 3 사용 메모리: 29,380 KB 소요 시간: 64 ms 해결 날짜: 2020년 9월 18일 | 3.456244 | 3 |
imgaug/augmentables/bbs.py | bill0714/imgaug | 1 | 10710 | from __future__ import print_function, division, absolute_import
import copy
import numpy as np
import skimage.draw
import skimage.measure
from .. import imgaug as ia
from .utils import normalize_shape, project_coords
# TODO functions: square(), to_aspect_ratio(), contains_point()
class BoundingBox(object):
""... | from __future__ import print_function, division, absolute_import
import copy
import numpy as np
import skimage.draw
import skimage.measure
from .. import imgaug as ia
from .utils import normalize_shape, project_coords
# TODO functions: square(), to_aspect_ratio(), contains_point()
class BoundingBox(object):
""... | en | 0.74666 | # TODO functions: square(), to_aspect_ratio(), contains_point() Class representing bounding boxes. Each bounding box is parameterized by its top left and bottom right corners. Both are given as x and y-coordinates. The corners are intended to lie inside the bounding box area. As a result, a bounding box th... | 2.820793 | 3 |
scanner_relay/run.py | breakds/brokering | 0 | 10711 | <gh_stars>0
#!/usr/bin/env python
from twisted.internet import endpoints
from twisted.internet import protocol
from twisted.internet import defer
from twisted.mail import imap4
from scanner_relay.pipeline import Pipeline
from scanner_relay.authentication import PassStoreFetcher, PlainPasswordFetcher
import logging
... | #!/usr/bin/env python
from twisted.internet import endpoints
from twisted.internet import protocol
from twisted.internet import defer
from twisted.mail import imap4
from scanner_relay.pipeline import Pipeline
from scanner_relay.authentication import PassStoreFetcher, PlainPasswordFetcher
import logging
# Global con... | en | 0.870873 | #!/usr/bin/env python # Global configuration for the logging. Note that we set the level to # INFO so that only DEBUG logging does not get to stdout. The entry point for the whole program. It merely starts the long-running pipeline. # NOTE: Although twisted official example suggest using the capabilities # ret... | 2.010756 | 2 |
cubes_pilingup.py | akiselev1/hackerrank-solutions | 0 | 10712 | """
Created by akiselev on 2019-06-14
There is a horizontal row of cubes. The length of each cube is given. You need to create a new vertical pile of cubes. The new pile should follow these directions: if is on top of then
.
When stacking the cubes, you can only pick up either the leftmost or the rightmost cube ... | """
Created by akiselev on 2019-06-14
There is a horizontal row of cubes. The length of each cube is given. You need to create a new vertical pile of cubes. The new pile should follow these directions: if is on top of then
.
When stacking the cubes, you can only pick up either the leftmost or the rightmost cube ... | en | 0.821491 | Created by akiselev on 2019-06-14 There is a horizontal row of cubes. The length of each cube is given. You need to create a new vertical pile of cubes. The new pile should follow these directions: if is on top of then . When stacking the cubes, you can only pick up either the leftmost or the rightmost cube each t... | 4.153783 | 4 |
flask_web/bootstrap_web_core_py3.py | bopopescu/docker_images_a | 0 | 10713 | <filename>flask_web/bootstrap_web_core_py3.py<gh_stars>0
#
#
# File: flask_web_py3.py
#
#
#
import os
import json
import redis
import urllib
import flask
from flask import Flask
from flask import render_template,jsonify
from flask_httpauth import HTTPDigestAuth
from flask import request, session, url_f... | <filename>flask_web/bootstrap_web_core_py3.py<gh_stars>0
#
#
# File: flask_web_py3.py
#
#
#
import os
import json
import redis
import urllib
import flask
from flask import Flask
from flask import render_template,jsonify
from flask_httpauth import HTTPDigestAuth
from flask import request, session, url_f... | en | 0.282121 | # # # File: flask_web_py3.py # # # #print("move directory path",path) #print(path) #print(path_dest) #os.system("ls flask_templates") #print("path",path,path_dest) #enable static files to be fetched #enable web access for redis operations # generalized graph search # Filter out rules we can't navigate to in a browser ... | 1.96469 | 2 |
git_talk/lib/changelog/main.py | cove9988/git-talk | 5 | 10714 | <filename>git_talk/lib/changelog/main.py<gh_stars>1-10
import os
import logging
from typing import Optional
import click
from git_talk.lib.changelog import generate_changelog
from git_talk.lib.changelog.presenter import MarkdownPresenter
from git_talk.lib.changelog.repository import GitRepository
#... | <filename>git_talk/lib/changelog/main.py<gh_stars>1-10
import os
import logging
from typing import Optional
import click
from git_talk.lib.changelog import generate_changelog
from git_talk.lib.changelog.presenter import MarkdownPresenter
from git_talk.lib.changelog.repository import GitRepository
#... | en | 0.283295 | # @click.command() # @click.option( # "-r", # "--repo", # type=click.Path(exists=True), # default=".", # help="Path to the repository's root directory [Default: .]", # ) # @click.option("-t", "--title", default="Changelog", help="The changelog's title [Default: Changelog]") # @click.option("-d", "--... | 2.283237 | 2 |
SQED-Generator/Generators/constraint_generator.py | upscale-project/generic-sqed-demo | 6 | 10715 | <reponame>upscale-project/generic-sqed-demo
# Copyright (c) Stanford University
#
# This source code is patent protected and being made available under the
# terms explained in the ../LICENSE-Academic and ../LICENSE-GOV files.
# Author: <NAME>
# Email: <EMAIL>
import copy
import sys
sys.path.append("../FormatParsers/... | # Copyright (c) Stanford University
#
# This source code is patent protected and being made available under the
# terms explained in the ../LICENSE-Academic and ../LICENSE-GOV files.
# Author: <NAME>
# Email: <EMAIL>
import copy
import sys
sys.path.append("../FormatParsers/")
sys.path.append("../Interface/")
import ... | en | 0.70028 | # Copyright (c) Stanford University # # This source code is patent protected and being made available under the # terms explained in the ../LICENSE-Academic and ../LICENSE-GOV files. # Author: <NAME> # Email: <EMAIL> # Get ISA information # Get register names # Get memory fields needed for modification # Get constraint... | 2.368483 | 2 |
modules/losses.py | Sapperdomonik/retinaface-tf2 | 0 | 10716 | import tensorflow as tf
def _smooth_l1_loss(y_true, y_pred):
t = tf.abs(y_pred - y_true)
return tf.where(t < 1, 0.5 * t ** 2, t - 0.5)
def MultiBoxLoss(num_class=2, neg_pos_ratio=3):
"""multi-box loss"""
def multi_box_loss(y_true, y_pred):
num_batch = tf.shape(y_true)[0]
num_prior = ... | import tensorflow as tf
def _smooth_l1_loss(y_true, y_pred):
t = tf.abs(y_pred - y_true)
return tf.where(t < 1, 0.5 * t ** 2, t - 0.5)
def MultiBoxLoss(num_class=2, neg_pos_ratio=3):
"""multi-box loss"""
def multi_box_loss(y_true, y_pred):
num_batch = tf.shape(y_true)[0]
num_prior = ... | en | 0.788595 | multi-box loss # define filter mask: class_true = 1 (pos), 0 (neg), -1 (ignore) # landm_valid = 1 (w landm), 0 (w/o landm) # landm loss (smooth L1) # localization loss (smooth L1) # classification loss (crossentropy) # 1. compute max conf across batch for hard negative mining # 2. hard negative mini... | 2.432049 | 2 |
tests.py | ckelly/pybingmaps | 0 | 10717 | <reponame>ckelly/pybingmaps
import unittest
import random
from time import sleep
import os
from bingmaps import *
class BingMapsTestError(Exception):
"""Bing Maps test exception"""
def __init__(self, reason):
self.reason = unicode(reason)
def __str__(self):
return self.reason
# TODO: en... | import unittest
import random
from time import sleep
import os
from bingmaps import *
class BingMapsTestError(Exception):
"""Bing Maps test exception"""
def __init__(self, reason):
self.reason = unicode(reason)
def __str__(self):
return self.reason
# TODO: enter your key for testing
api... | en | 0.865721 | Bing Maps test exception # TODO: enter your key for testing # start - 717 Market St # end - Ferry Plaza, San Francisco, CA # we shrunk the precision to match return values for easier comparison # verify start and end points are reflected in response # skip the last step, as it doesn't have a transport Mode # skip the ... | 3.15805 | 3 |
fds/config.py | dvershinin/fds | 9 | 10718 | <filename>fds/config.py
from cds.CloudflareWrapper import suggest_set_up, cf_config_filename
from .FirewallWrapper import FirewallWrapper
import logging as log
def open_web_if_webserver_running():
fw = FirewallWrapper()
from .utils import is_process_running, query_yes_no
webserver_running = is_process_run... | <filename>fds/config.py
from cds.CloudflareWrapper import suggest_set_up, cf_config_filename
from .FirewallWrapper import FirewallWrapper
import logging as log
def open_web_if_webserver_running():
fw = FirewallWrapper()
from .utils import is_process_running, query_yes_no
webserver_running = is_process_run... | en | 0.661594 | # if nginx runs, check/ask to ensure open web ports: # if cloudflare.cfg is missing, check/ask to ensure Cloudflare support: | 2.414877 | 2 |
awardapp/migrations/0004_auto_20191024_1607.py | Elisephan/Awards-project | 0 | 10719 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-10-24 16:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awardapp', '0003_auto_20191024_1606'),
]
operations = [
migrations.AlterField... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-10-24 16:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awardapp', '0003_auto_20191024_1606'),
]
operations = [
migrations.AlterField... | en | 0.792713 | # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-10-24 16:07 | 1.372422 | 1 |
hikari/events/channel_events.py | Reliku/hikari | 0 | 10720 | <reponame>Reliku/hikari<gh_stars>0
# -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
#
# 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, incl... | # -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
#
# 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... | en | 0.832842 | # -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # # 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... | 1.439952 | 1 |
tests/unit/test_coordinator.py | sopel39/presto-admin | 34 | 10721 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | en | 0.840628 | # -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ... | 1.520716 | 2 |
other/string chains/strings4.py | saulc/myth-math | 0 | 10722 | # <NAME>
# <NAME>
# config file format
import random
def openFile():
file = open("test.txt", 'r')
return file
def printFile(f):
print(f.read())
def readInput():
testout = "CarpenteRatcheThread"
file = open("test.txt", 'r')
s = str(file.read())
words = s.split(" ");
# print("Expect... | # <NAME>
# <NAME>
# config file format
import random
def openFile():
file = open("test.txt", 'r')
return file
def printFile(f):
print(f.read())
def readInput():
testout = "CarpenteRatcheThread"
file = open("test.txt", 'r')
s = str(file.read())
words = s.split(" ");
# print("Expect... | en | 0.721229 | # <NAME> # <NAME> # config file format # print("Expected Output: " + testout) # makeChains(words) # words, i = showlist(inputstr, False) # showlist(ret, False) # showlist(w, True) # print(i, " : ", words[i]) # print(" ", words[j], words[i]) #raw data #data only #show it # list to string with sep 'char' # string to... | 3.524371 | 4 |
supervised_learning/analysis.py | gonzalezJohnas/SpeechCommand-recognition | 0 | 10723 | from global_utils import *
# target word
TARGET_WORD = 'right'
def display_lowpass_normal(wav, lowpass_signal, fs, label=''):
fig, (axs_raw, axs_low) = plt.subplots(2)
fig.tight_layout(pad=3.0)
fig.set_figheight(FIG_HEIGHT)
fig.set_figwidth(FIG_WIDTH)
# display the plot
axs_raw.plot(wav)
... | from global_utils import *
# target word
TARGET_WORD = 'right'
def display_lowpass_normal(wav, lowpass_signal, fs, label=''):
fig, (axs_raw, axs_low) = plt.subplots(2)
fig.tight_layout(pad=3.0)
fig.set_figheight(FIG_HEIGHT)
fig.set_figwidth(FIG_WIDTH)
# display the plot
axs_raw.plot(wav)
... | en | 0.501985 | # target word # display the plot # label the axes # set the title # label the axes # set the title | 2.603808 | 3 |
qnarre/base/proof.py | quantapix/qnarre.com | 0 | 10724 | # Copyright 2019 Quantapix Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2019 Quantapix Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | en | 0.813792 | # Copyright 2019 Quantapix Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l... | 2.273734 | 2 |
learningPygame/Dave/06-SpaceInvaders/space_invaders.py | Rosebotics/catapult2019 | 0 | 10725 | import pygame, sys, random, time
from pygame.locals import *
class Missile:
def __init__(self, screen, x):
# Store the data. Initialize: y to 591 and exploded to False.
self.screen = screen
self.x = x
self.y = 591
self.exploded = False
def move(self):
# ... | import pygame, sys, random, time
from pygame.locals import *
class Missile:
def __init__(self, screen, x):
# Store the data. Initialize: y to 591 and exploded to False.
self.screen = screen
self.x = x
self.y = 591
self.exploded = False
def move(self):
# ... | en | 0.865241 | # Store the data. Initialize: y to 591 and exploded to False. # Make self.y 5 smaller than it was (which will cause the Missile to move UP). # Draw a vertical, 4 pixels thick, 8 pixels long, red (or green) line on the screen, # where the line starts at the current position of this Missile. # Store the data. # Se... | 3.283297 | 3 |
tests/test_app/rest_app/rest_app/controllers/config_controller.py | jadbin/guniflask | 12 | 10726 | from guniflask.config import settings
from guniflask.web import blueprint, get_route
@blueprint
class ConfigController:
def __init__(self):
pass
@get_route('/settings/<name>')
def get_setting(self, name):
return {name: settings[name]}
| from guniflask.config import settings
from guniflask.web import blueprint, get_route
@blueprint
class ConfigController:
def __init__(self):
pass
@get_route('/settings/<name>')
def get_setting(self, name):
return {name: settings[name]}
| none | 1 | 1.895714 | 2 | |
model/_UNet_trainer.py | yasahi-hpc/AMRNet | 0 | 10727 | <gh_stars>0
from ._base_trainer import _BaseTrainer, MeasureMemory
import pathlib
import torch.multiprocessing as mp
import torch
from torch import nn
import horovod.torch as hvd
import numpy as np
import xarray as xr
import itertools
from .flow_dataset import FlowDataset
from .unet import UNet
import sys
from .visuali... | from ._base_trainer import _BaseTrainer, MeasureMemory
import pathlib
import torch.multiprocessing as mp
import torch
from torch import nn
import horovod.torch as hvd
import numpy as np
import xarray as xr
import itertools
from .flow_dataset import FlowDataset
from .unet import UNet
import sys
from .visualization impor... | en | 0.600346 | # Horovod: Initialize library # Horovod: Pin GPU to be used to process local rank (one GPU per process) # Horovod: limit # of CPU threads to be used per worker. ## Optimizers # By default, Adasum doesn't need scaling up leraning rate # Horovod: broadcast parameters & optimizer state. # Horovod: (optional) compression a... | 2.024745 | 2 |
agents/vpg_policy_translation_with_dislocation.py | pjarosik/rlus | 3 | 10728 | <reponame>pjarosik/rlus
from spinup import vpg
import tensorflow as tf
import numpy as np
from gym.spaces import Box, Discrete
from envs.focal_point_task_us_env import FocalPointTaskUsEnv
from envs.phantom import (
ScatterersPhantom,
Ball,
Teddy
)
from envs.imaging import ImagingSystem, Probe
from envs.gene... | from spinup import vpg
import tensorflow as tf
import numpy as np
from gym.spaces import Box, Discrete
from envs.focal_point_task_us_env import FocalPointTaskUsEnv
from envs.phantom import (
ScatterersPhantom,
Ball,
Teddy
)
from envs.imaging import ImagingSystem, Probe
from envs.generator import ConstPhanto... | en | 0.680341 | # NO_EPISODES = (NSTEPS_PER_EPOCH/NSTEPS_PER_EPISODE)*EPOCHS # only X and Y # [pixels] # probe_dislocation_prob=0, # max_probe_dislocation=2, # dislocation_seed=42 # Below functions base on openai.spinup's A-C scheme implementation. # x = tf.nn.tanh(x) # action drawn from current policy # log probability of given actio... | 1.832565 | 2 |
lib/losses/dice.py | zongdaoming/CMT | 3 | 10729 | import sys,os
sys.path.append('/home/zongdaoming/cv/multi-organ/multi-organ-ijcai')
from lib.losses.BaseClass import _AbstractDiceLoss
from lib.losses.basic import *
class DiceLoss(_AbstractDiceLoss):
"""Computes Dice Loss according to https://arxiv.org/abs/1606.04797.
For multi-class segmentation `weight` pa... | import sys,os
sys.path.append('/home/zongdaoming/cv/multi-organ/multi-organ-ijcai')
from lib.losses.BaseClass import _AbstractDiceLoss
from lib.losses.basic import *
class DiceLoss(_AbstractDiceLoss):
"""Computes Dice Loss according to https://arxiv.org/abs/1606.04797.
For multi-class segmentation `weight` pa... | en | 0.695353 | Computes Dice Loss according to https://arxiv.org/abs/1606.04797. For multi-class segmentation `weight` parameter can be used to assign different weights per class. | 2.400475 | 2 |
icons.py | jasantunes/alfred-golinks | 312 | 10730 | <gh_stars>100-1000
# encoding: utf-8
#
# Copyright (c) 2019 <NAME> <<EMAIL>>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2019-09-06
#
"""Overlay check mark on icons."""
from __future__ import print_function, absolute_import
from Cocoa import (
NSBitmapImageRep,
NSPNGFileType,
... | # encoding: utf-8
#
# Copyright (c) 2019 <NAME> <<EMAIL>>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2019-09-06
#
"""Overlay check mark on icons."""
from __future__ import print_function, absolute_import
from Cocoa import (
NSBitmapImageRep,
NSPNGFileType,
NSImage,
NSMake... | en | 0.592877 | # encoding: utf-8 # # Copyright (c) 2019 <NAME> <<EMAIL>> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2019-09-06 # Overlay check mark on icons. Create image ``dest`` by putting ``overlay`` on top of ``src``. Args: src (str): Path to source image. overlay (str): Path to ov... | 1.674414 | 2 |
project/python/Main/CTRL/tracker.py | warak/IOT-GrannyWarden | 0 | 10731 | import datetime
from threading import Thread
from time import sleep
import DBC.dbcreate as dbc
class Tracker(Thread):
max_idle_time = 720 # minutes
default_sleep = 3600 # secs
def track(self):
dbcl = dbc.DBClient()
# print(dbcl.getlasttime())
print("Tracker activated")
... | import datetime
from threading import Thread
from time import sleep
import DBC.dbcreate as dbc
class Tracker(Thread):
max_idle_time = 720 # minutes
default_sleep = 3600 # secs
def track(self):
dbcl = dbc.DBClient()
# print(dbcl.getlasttime())
print("Tracker activated")
... | fi | 0.849457 | # minutes # secs # print(dbcl.getlasttime()) # print(yearmonthday) # print(hoursminutes) #print(yearmonthday) #print(hoursminutes) # tämä loopitus tyhmää, voisi käyttää valmista kirjastoa # puutteellinen #print(away) | 3.099842 | 3 |
tests/unit/test_snapshot.py | cnnradams/python-spanner | 0 | 10732 | # Copyright 2016 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright 2016 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | en | 0.77779 | # Copyright 2016 Google LLC All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 1.983594 | 2 |
hashtable.py | quake0day/oj | 0 | 10733 | A = ['a','b']
B = ['c','b','a']
def generatehash(A):
hashA = {}
for item in A:
if item not in hashA:
hashA[item] = 1
else:
hashA[item] += 1
return hashA
def compareHash(A, B):
lenA = len(A)
lenB = len(B)
hashA = generatehash(A)
if lenB < lenA:
... | A = ['a','b']
B = ['c','b','a']
def generatehash(A):
hashA = {}
for item in A:
if item not in hashA:
hashA[item] = 1
else:
hashA[item] += 1
return hashA
def compareHash(A, B):
lenA = len(A)
lenB = len(B)
hashA = generatehash(A)
if lenB < lenA:
... | none | 1 | 3.627682 | 4 | |
Manipulation of PDF Files/pandf_gui.py | clair513/DIY | 1 | 10734 | <filename>Manipulation of PDF Files/pandf_gui.py
# Importing required packages:
import pandas as pd
from tkinter import *
from tkinter.ttk import *
root = Tk()
# To visualize input DataFrame:
def generate_plot(gui_root, df, x_axis, y_axis=None,
plot={'type':None, 'hue':None},
... | <filename>Manipulation of PDF Files/pandf_gui.py
# Importing required packages:
import pandas as pd
from tkinter import *
from tkinter.ttk import *
root = Tk()
# To visualize input DataFrame:
def generate_plot(gui_root, df, x_axis, y_axis=None,
plot={'type':None, 'hue':None},
... | en | 0.649799 | # Importing required packages: # To visualize input DataFrame: DESCRIPTION: Reads input Pandas DataFrame and returns a plot based on selected parameters.
PARAMETERS:
> gui_root : [Required] Accepts Tkinter application base class (Tk) initialized variable/instance.
> df : [Required] Accepts Pand... | 3.394244 | 3 |
utils/get_dataset.py | gautierdag/pytorch-attentive-lm | 16 | 10735 | <gh_stars>10-100
import os
import torch
from torch.utils.data import DataLoader, TensorDataset
import requests
import io
import zipfile
from .data_reader import read_vocabulary, read_lm_data, lm_data_producer
from .pre_process_wikitext import pre_process
def get_dataset(dataset, batch_size, device):
"""
Retu... | import os
import torch
from torch.utils.data import DataLoader, TensorDataset
import requests
import io
import zipfile
from .data_reader import read_vocabulary, read_lm_data, lm_data_producer
from .pre_process_wikitext import pre_process
def get_dataset(dataset, batch_size, device):
"""
Returns data iterator... | en | 0.713527 | Returns data iterator for each set and vocabulary # downloads and preprocess dataset if needed # add 1 to account for PAD # add 1 to account for PAD # Convert numpy to datasets and obtain iterators for each # downloading/preprocessing functions # To save to a relative path. | 2.584593 | 3 |
Conteudo das Aulas/087/calc_est.py | cerberus707/lab-python | 0 | 10736 | from tkinter import *
#Cria a nossa tela
instancia = Tk()
#Dá um título a tela
instancia.title('Calculadora para Estatística')
#Dá um tamanho a tela
instancia.geometry("800x600")
#Dá um ícone ao aplicativo
#instancia.wm_iconbitmap('icone.ico')
#Inicia o programa
instancia.mainloop()
| from tkinter import *
#Cria a nossa tela
instancia = Tk()
#Dá um título a tela
instancia.title('Calculadora para Estatística')
#Dá um tamanho a tela
instancia.geometry("800x600")
#Dá um ícone ao aplicativo
#instancia.wm_iconbitmap('icone.ico')
#Inicia o programa
instancia.mainloop()
| pt | 0.895104 | #Cria a nossa tela #Dá um título a tela #Dá um tamanho a tela #Dá um ícone ao aplicativo #instancia.wm_iconbitmap('icone.ico') #Inicia o programa | 3.448497 | 3 |
property_scraper.py | iplaughlin/property_scraping | 0 | 10737 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 19 09:42:09 2022
@author: iaala
"""
import requests
import sql_configs
import datetime
import os
from bs4 import BeautifulSoup
import time
from find_tables import (
table_information_one,
table_information_two,
table_information_three,
table_information_... | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 19 09:42:09 2022
@author: iaala
"""
import requests
import sql_configs
import datetime
import os
from bs4 import BeautifulSoup
import time
from find_tables import (
table_information_one,
table_information_two,
table_information_three,
table_information_... | en | 0.55106 | # -*- coding: utf-8 -*- Created on Sat Mar 19 09:42:09 2022 @author: iaala # raise Exception | 2.556087 | 3 |
Chapter03/Activity11/fibonacci.py | vumaasha/python-workshop | 0 | 10738 | def fibonacci_iterative(n):
previous = 0
current = 1
for i in range(n - 1):
current_old = current
current = previous + current
previous = current_old
return current
def fibonacci_recursive(n):
if n == 0 or n == 1:
return n
else:
return fibonacci_recursive... | def fibonacci_iterative(n):
previous = 0
current = 1
for i in range(n - 1):
current_old = current
current = previous + current
previous = current_old
return current
def fibonacci_recursive(n):
if n == 0 or n == 1:
return n
else:
return fibonacci_recursive... | none | 1 | 4.248877 | 4 | |
matches/tests/test_view_index.py | ToxaZ/nostradamus | 0 | 10739 | <filename>matches/tests/test_view_index.py
from django.urls import resolve, reverse
from django.test import TestCase
from matches.views import matches_index
from matches.models import Match
class AllMatchesTests(TestCase):
def setUp(self):
self.match = Match.objects.create(
match_id=1,
... | <filename>matches/tests/test_view_index.py
from django.urls import resolve, reverse
from django.test import TestCase
from matches.views import matches_index
from matches.models import Match
class AllMatchesTests(TestCase):
def setUp(self):
self.match = Match.objects.create(
match_id=1,
... | none | 1 | 2.339883 | 2 | |
hmc/applications/banana/banana.py | JamesBrofos/Thresholds-in-Hamiltonian-Monte-Carlo | 1 | 10740 | from typing import Callable, Tuple
import numpy as np
def posterior_factory(y: np.ndarray, sigma_y: float, sigma_theta: float) -> Tuple[Callable]:
"""The banana distribution is a distribution that exhibits a characteristic
banana-shaped ridge that resembles the posterior that can emerge from
models that ... | from typing import Callable, Tuple
import numpy as np
def posterior_factory(y: np.ndarray, sigma_y: float, sigma_theta: float) -> Tuple[Callable]:
"""The banana distribution is a distribution that exhibits a characteristic
banana-shaped ridge that resembles the posterior that can emerge from
models that ... | en | 0.747928 | The banana distribution is a distribution that exhibits a characteristic banana-shaped ridge that resembles the posterior that can emerge from models that are not identifiable. The distribution is the posterior of the following generative model. y ~ Normal(theta[0] + theta[1]**2, sigma_sq_y) ... | 3.15785 | 3 |
msp430.py | sprout42/binaryninja-msp430 | 0 | 10741 | <reponame>sprout42/binaryninja-msp430
from binaryninja import (
Architecture,
BranchType,
FlagRole,
InstructionInfo,
LowLevelILFlagCondition,
RegisterInfo,
)
from .instructions import TYPE3_INSTRUCTIONS, Instruction, Registers
from .lifter import Lifter
class MSP430(Architecture):
name = ... | from binaryninja import (
Architecture,
BranchType,
FlagRole,
InstructionInfo,
LowLevelILFlagCondition,
RegisterInfo,
)
from .instructions import TYPE3_INSTRUCTIONS, Instruction, Registers
from .lifter import Lifter
class MSP430(Architecture):
name = "msp430"
address_size = 2
defa... | en | 0.828199 | # The first flag write type is ignored currently. # See: https://github.com/Vector35/binaryninja-api/issues/513 # Add branches # Halting the system means turning off interrupts and just looping # indefinitely | 1.994128 | 2 |
app/domain/__init__.py | emge1/tracardi | 0 | 10742 | __all__ = [
'session',
'event',
'profile',
'consent',
'segment',
'source',
'rule',
'entity'
]
| __all__ = [
'session',
'event',
'profile',
'consent',
'segment',
'source',
'rule',
'entity'
]
| none | 1 | 1.02159 | 1 | |
metric_calculation/faster_metrics.py | imatge-upc/saliency-2018-videosalgan | 10 | 10743 | <reponame>imatge-upc/saliency-2018-videosalgan<filename>metric_calculation/faster_metrics.py<gh_stars>1-10
from salience_metrics import auc_judd, auc_shuff, cc, nss, similarity, normalize_map
"""
DHF1K paper: "we employ five classic met-rics, namely Normalized Scanpath Saliency (NSS), Sim-ilarity Metric (SIM)... | from salience_metrics import auc_judd, auc_shuff, cc, nss, similarity, normalize_map
"""
DHF1K paper: "we employ five classic met-rics, namely Normalized Scanpath Saliency (NSS), Sim-ilarity Metric (SIM), Linear Correlation Coefficient (CC),AUC-Judd (AUC-J), and shuffled AUC (s-AUC).""
"""
import cv2
import o... | en | 0.85873 | DHF1K paper: "we employ five classic met-rics, namely Normalized Scanpath Saliency (NSS), Sim-ilarity Metric (SIM), Linear Correlation Coefficient (CC),AUC-Judd (AUC-J), and shuffled AUC (s-AUC)."" # The directories are named 1-1000 so it should be easy to iterate over them #packed should be a list of tuples ... | 2.297996 | 2 |
tests/rules/test_pacman_invalid_option.py | RogueScholar/thefuck-termux | 0 | 10744 | import pytest
from thefuck.rules.pacman_invalid_option import get_new_command
from thefuck.rules.pacman_invalid_option import match
from thefuck.types import Command
good_output = """community/shared_meataxe 1.0-3
A set of programs for working with matrix representations over finite fields
"""
bad_output = "erro... | import pytest
from thefuck.rules.pacman_invalid_option import get_new_command
from thefuck.rules.pacman_invalid_option import match
from thefuck.types import Command
good_output = """community/shared_meataxe 1.0-3
A set of programs for working with matrix representations over finite fields
"""
bad_output = "erro... | en | 0.888282 | community/shared_meataxe 1.0-3 A set of programs for working with matrix representations over finite fields | 2.825345 | 3 |
dimod/reference/composites/scalecomposite.py | joseppinilla/dimod | 1 | 10745 | <reponame>joseppinilla/dimod<filename>dimod/reference/composites/scalecomposite.py
# Copyright 2019 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... | # Copyright 2019 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | en | 0.774857 | # Copyright 2019 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or... | 2.267074 | 2 |
tests/test_config.py | savilard/flask-ecom-api | 1 | 10746 | import os
def test_development_config(test_app):
test_app.config.from_object('flask_ecom_api.config.DevelopmentConfig')
assert not test_app.config['TESTING']
assert test_app.config['SQLALCHEMY_DATABASE_URI'] == os.environ.get('DATABASE_URL')
def test_testing_config(test_app):
test_app.config.from_ob... | import os
def test_development_config(test_app):
test_app.config.from_object('flask_ecom_api.config.DevelopmentConfig')
assert not test_app.config['TESTING']
assert test_app.config['SQLALCHEMY_DATABASE_URI'] == os.environ.get('DATABASE_URL')
def test_testing_config(test_app):
test_app.config.from_ob... | none | 1 | 2.309867 | 2 | |
leasing/forms.py | suutari-ai/mvj | 1 | 10747 | from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from leasing.enums import (
InfillDevelopmentCompensationState,
LeaseState,
TenantContactType,
)
from leasing.models import Contact, DecisionMaker, District, LeaseType, Municipality
from leasing.v... | from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from leasing.enums import (
InfillDevelopmentCompensationState,
LeaseState,
TenantContactType,
)
from leasing.models import Contact, DecisionMaker, District, LeaseType, Municipality
from leasing.v... | en | 0.882929 | # Validate that each value in the value list is in self.choices. | 2.165782 | 2 |
src/main/management/commands/create_admin_user.py | LokotamaTheMastermind/website-portfolio-django-project | 0 | 10748 | # polls/management/commands/create_admin_user.py
import sys
import logging
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.conf import settings
class Command(BaseCommand):
help = 'Creates the initial admin user'
def handle(self, *args... | # polls/management/commands/create_admin_user.py
import sys
import logging
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.conf import settings
class Command(BaseCommand):
help = 'Creates the initial admin user'
def handle(self, *args... | en | 0.594959 | # polls/management/commands/create_admin_user.py | 2.291732 | 2 |
app.py | jdanper/incredipaper | 0 | 10749 | import unirest
import json
import requests
import os
import subprocess
import time
import argparse
rootUrl = "https://api.unsplash.com/"
unirest.default_header("Accept", "application/json")
unirest.default_header("Accept-Version", "v1")
unirest.default_header("Authorization","<CLIENT-ID>")
def downloadPic(randomPic_... | import unirest
import json
import requests
import os
import subprocess
import time
import argparse
rootUrl = "https://api.unsplash.com/"
unirest.default_header("Accept", "application/json")
unirest.default_header("Accept-Version", "v1")
unirest.default_header("Authorization","<CLIENT-ID>")
def downloadPic(randomPic_... | zh | 0.431891 | #, callback=applyWallpaper)#.body["urls"]["regular"] #.body["id"] | 2.627622 | 3 |
tests/client_asyncio_test.py | ninchat/ninchat-python | 0 | 10750 | <gh_stars>0
# Copyright (c) 2017, <NAME>
# 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 list of conditions ... | # Copyright (c) 2017, <NAME>
# 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 list of conditions and the foll... | en | 0.684785 | # Copyright (c) 2017, <NAME> # 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 list of conditions and the foll... | 1.643574 | 2 |
msgraph/base.py | jstacoder/python-msgraph | 2 | 10751 | <reponame>jstacoder/python-msgraph
from datetime import datetime
class Base(object):
date_format = '%Y-%m-%d'
time_format = '%H:%M:%S'
datetime_format = date_format + 'T%s' % time_format
full_datetime_format = date_format + 'T' + time_format + '.%f'
iso_format = date_format + 'T%sZ' % time_format
... | from datetime import datetime
class Base(object):
date_format = '%Y-%m-%d'
time_format = '%H:%M:%S'
datetime_format = date_format + 'T%s' % time_format
full_datetime_format = date_format + 'T' + time_format + '.%f'
iso_format = date_format + 'T%sZ' % time_format
standard_datetime_format = date... | none | 1 | 3.420516 | 3 | |
nc/models.py | caktus/Traffic-Stops | 1 | 10752 | from caching.base import CachingManager, CachingMixin
from django.db import models
from tsdata.models import CensusProfile
PURPOSE_CHOICES = (
(1, "Speed Limit Violation"),
(2, "Stop Light/Sign Violation"),
(3, "Driving While Impaired"),
(4, "Safe Movement Violation"),
(5, "Vehicle Equipment Violat... | from caching.base import CachingManager, CachingMixin
from django.db import models
from tsdata.models import CensusProfile
PURPOSE_CHOICES = (
(1, "Speed Limit Violation"),
(2, "Stop Light/Sign Violation"),
(3, "Driving While Impaired"),
(4, "Safe Movement Violation"),
(5, "Vehicle Equipment Violat... | en | 0.443183 | # todo: keys # todo: keys # link to CensusProfile (no cross-database foreign key) | 1.987904 | 2 |
flasky/auth/forms/__init__.py | by46/fasky | 0 | 10753 | <reponame>by46/fasky<gh_stars>0
from .login import LoginForm
from .registration import RegistrationForm
| from .login import LoginForm
from .registration import RegistrationForm | none | 1 | 1.02854 | 1 | |
API_SIMIT_Mail/multapp/urls.py | profefonso/Services-SM | 0 | 10754 | from django.urls import path
from django.contrib import admin
from rest_framework_swagger.views import get_swagger_view
from .views import notification
schema_view = get_swagger_view(title='MAIL API')
urlpatterns = [
path('front/betsy/irish/embargo/admin/', admin.site.urls),
# Swagger API
path(
... | from django.urls import path
from django.contrib import admin
from rest_framework_swagger.views import get_swagger_view
from .views import notification
schema_view = get_swagger_view(title='MAIL API')
urlpatterns = [
path('front/betsy/irish/embargo/admin/', admin.site.urls),
# Swagger API
path(
... | en | 0.476398 | # Swagger API # notification | 1.602737 | 2 |
tests/legacy_mocket.py | jepler/Adafruit_CircuitPython_Requests | 0 | 10755 | <filename>tests/legacy_mocket.py
from unittest import mock
SOCK_STREAM = 0
set_interface = mock.Mock()
interface = mock.MagicMock()
getaddrinfo = mock.Mock()
socket = mock.Mock()
class Mocket:
def __init__(self, response):
self.settimeout = mock.Mock()
self.close = mock.Mock()
self.conne... | <filename>tests/legacy_mocket.py
from unittest import mock
SOCK_STREAM = 0
set_interface = mock.Mock()
interface = mock.MagicMock()
getaddrinfo = mock.Mock()
socket = mock.Mock()
class Mocket:
def __init__(self, response):
self.settimeout = mock.Mock()
self.close = mock.Mock()
self.conne... | none | 1 | 2.849916 | 3 | |
run.py | romeroyakovlev/ii | 1 | 10756 | # -*- coding: utf-8 -*-
import api,points
from api.bottle import *
II_PATH=os.path.dirname(__file__) or '.'
TEMPLATE_PATH.insert(0,II_PATH)
@route('/list.txt')
def list_txt():
response.set_header ('content-type','text/plain; charset=utf-8')
lst = api.load_echo(False)[1:]
if request.query.n:
retur... | # -*- coding: utf-8 -*-
import api,points
from api.bottle import *
II_PATH=os.path.dirname(__file__) or '.'
TEMPLATE_PATH.insert(0,II_PATH)
@route('/list.txt')
def list_txt():
response.set_header ('content-type','text/plain; charset=utf-8')
lst = api.load_echo(False)[1:]
if request.query.n:
retur... | ru | 0.983673 | # -*- coding: utf-8 -*- # а ещё лучше - засунуть это в api.toss | 2.218755 | 2 |
learning_labs/yang/01-yang/add_loopback_ip.py | hpreston/sbx_nxos | 33 | 10757 | #!/usr/bin/env python
from ncclient import manager
import sys
from lxml import etree
# Set the device variables
DEVICES = ['172.16.30.101', '172.16.30.102']
USER = 'admin'
PASS = '<PASSWORD>'
PORT = 830
LOOPBACK_IP = {
'172.16.30.101': '10.99.99.1/24',
'172.16.30.102': '10.99.99.2/24'
}
DEVICE_NAMES = {'172... | #!/usr/bin/env python
from ncclient import manager
import sys
from lxml import etree
# Set the device variables
DEVICES = ['172.16.30.101', '172.16.30.102']
USER = 'admin'
PASS = '<PASSWORD>'
PORT = 830
LOOPBACK_IP = {
'172.16.30.101': '10.99.99.1/24',
'172.16.30.102': '10.99.99.2/24'
}
DEVICE_NAMES = {'172... | en | 0.323542 | #!/usr/bin/env python # Set the device variables # create a main() method Main method that adds an IP address to interface loopback 99 to both the spine switches. <config> <System xmlns="http://cisco.com/ns/yang/cisco-nx-os-device"> <ipv4-items> <inst-items> <dom-items> <... | 2.660932 | 3 |
Plotly_Dash/spacex_dash_app.py | AtypicalLogic/Coursera-IBM_DS-Applied_Data_Science_Capstone | 0 | 10758 | <reponame>AtypicalLogic/Coursera-IBM_DS-Applied_Data_Science_Capstone
# To run this file, Win Start > cmd > file dir > run: python spacex_dash_app.py
# Import required libraries
import pandas as pd
import dash
from dash import html
from dash import dcc
from dash.dependencies import Input, Output
import plotly.express a... | # To run this file, Win Start > cmd > file dir > run: python spacex_dash_app.py
# Import required libraries
import pandas as pd
import dash
from dash import html
from dash import dcc
from dash.dependencies import Input, Output
import plotly.express as px
# Read the airline data into pandas dataframe
spacex_df = pd.rea... | en | 0.776066 | # To run this file, Win Start > cmd > file dir > run: python spacex_dash_app.py # Import required libraries # Read the airline data into pandas dataframe # Dropdown list(s) # Create a dash application # Create an app layout # TASK 1: Add a dropdown list to enable Launch Site selection # The default select value is for ... | 3.500594 | 4 |
configs/mnist_paper_residual_cnn_gp.py | rhaps0dy/cnn-gp | 23 | 10759 | <reponame>rhaps0dy/cnn-gp
"""
The best randomly-searched ResNet reported in the paper.
In the original paper there is a bug. This network sums together layers after
the ReLU nonlinearity, which are not Gaussian, and also do not have mean 0. As
a result, the overall network does not converge to a Gaussian process. The
... | """
The best randomly-searched ResNet reported in the paper.
In the original paper there is a bug. This network sums together layers after
the ReLU nonlinearity, which are not Gaussian, and also do not have mean 0. As
a result, the overall network does not converge to a Gaussian process. The
defined kernel is still va... | en | 0.942041 | The best randomly-searched ResNet reported in the paper. In the original paper there is a bug. This network sums together layers after the ReLU nonlinearity, which are not Gaussian, and also do not have mean 0. As a result, the overall network does not converge to a Gaussian process. The defined kernel is still valid,... | 3.108507 | 3 |
python/learn/PythonDataVisualizationCookbookSE_Code/Chapter 07/ch07_rec08_scatterplot.py | flyingwjw/Documentation | 0 | 10760 | <gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
# daily search trend for keyword 'flowers' for a year
d = [
1.04, 1.04, 1.16, 1.22, 1.46, 2.34, 1.16, 1.12, 1.24, 1.30, 1.44, 1.22, 1.26,
1.34, 1.26, 1.40, 1.52, 2.56, 1.36, 1.30, 1.20, 1.12, 1.12, 1.12, 1.06, 1.06,
1.00, 1.02, 1.04, 1.02, 1.06, 1.02, 1... | import matplotlib.pyplot as plt
import numpy as np
# daily search trend for keyword 'flowers' for a year
d = [
1.04, 1.04, 1.16, 1.22, 1.46, 2.34, 1.16, 1.12, 1.24, 1.30, 1.44, 1.22, 1.26,
1.34, 1.26, 1.40, 1.52, 2.56, 1.36, 1.30, 1.20, 1.12, 1.12, 1.12, 1.06, 1.06,
1.00, 1.02, 1.04, 1.02, 1.06, 1.02, 1.04, 0.98, 0... | en | 0.668601 | # daily search trend for keyword 'flowers' for a year # Now let's generate random data for the same period | 2.276516 | 2 |
src/thespian/tweaks.py | mtttech/dndpersonae | 1 | 10761 | from dataclasses import dataclass
import logging
from attributes import get_ability_modifier
from sourcetree.utils import (
get_feats_list,
get_feat_perks,
get_feat_proficiencies,
get_feat_requirements,
)
from stdio import prompt
log = logging.getLogger("thespian.tweaks")
class AbilityScoreImproveme... | from dataclasses import dataclass
import logging
from attributes import get_ability_modifier
from sourcetree.utils import (
get_feats_list,
get_feat_perks,
get_feat_proficiencies,
get_feat_requirements,
)
from stdio import prompt
log = logging.getLogger("thespian.tweaks")
class AbilityScoreImproveme... | en | 0.74451 | Handles ability score improvement errors. Handles an invalid flag format error. Generates and parses feat characteristic flags by feat. FLAG OPTION PARSER SYSTEM PIPEBAR: Used to separate flags. i.e: ability=Strength|proficiency=skills Two flag options are designated in the above example: 'ability', a... | 3.367597 | 3 |
atomic1D/ImpuritySpecies.py | TBody/atomic1D | 1 | 10762 | class ImpuritySpecies(object):
# For storing OpenADAS data related to a particular impurity species
# Loosely based on cfe316/atomic/atomic_data.py/AtomicData class (although with much less code since
# all of the F77 importing is done in the seperate <<make json_update>> code since BOUT++ protocol
# requires fort... | class ImpuritySpecies(object):
# For storing OpenADAS data related to a particular impurity species
# Loosely based on cfe316/atomic/atomic_data.py/AtomicData class (although with much less code since
# all of the F77 importing is done in the seperate <<make json_update>> code since BOUT++ protocol
# requires fort... | en | 0.706586 | # For storing OpenADAS data related to a particular impurity species # Loosely based on cfe316/atomic/atomic_data.py/AtomicData class (although with much less code since # all of the F77 importing is done in the seperate <<make json_update>> code since BOUT++ protocol # requires fortran code be isolated from main opera... | 2.7742 | 3 |
Utils/Matrix.py | valavanisleonidas/Machine_Learning_Toolkit | 0 | 10763 | <reponame>valavanisleonidas/Machine_Learning_Toolkit
import os
import platform
import numpy
class Matrix:
def __init__(self):
if platform.system() == "Windows":
self.delimiterForPath = "\\"
else:
self.delimiterForPath = "/"
self.labelsDType = numpy.int32
se... | import os
import platform
import numpy
class Matrix:
def __init__(self):
if platform.system() == "Windows":
self.delimiterForPath = "\\"
else:
self.delimiterForPath = "/"
self.labelsDType = numpy.int32
self.imagesDType = numpy.float32
def deleteRows(se... | en | 0.561047 | # path in format : ..\\Category\\ImageName # for all images in folder path # for all images in folder path # get category of image and add category to array # get image array and add image to array # convert lists to numpy array # returns batches from data with size batchSize # shuffle array1 (images) with correspondin... | 2.618847 | 3 |
networking_calico/plugins/ml2/drivers/calico/policy.py | manojcode/networking-calico | 0 | 10764 | <reponame>manojcode/networking-calico
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | # -*- coding: utf-8 -*-
# Copyright (c) 2018 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | en | 0.87971 | # -*- coding: utf-8 -*- # Copyright (c) 2018 Tigera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re... | 1.828248 | 2 |
25/main.py | gosha20777/mipt-bioinfo-2021 | 0 | 10765 | <filename>25/main.py<gh_stars>0
def global_alignment(seq1, seq2, score_matrix, penalty):
len1, len2 = len(seq1), len(seq2)
s = [[0] * (len2 + 1) for i in range(len1 + 1)]
backtrack = [[0] * (len2 + 1) for i in range(len1 + 1)]
for i in range(1, len1 + 1):
s[i][0] = - i * penalty
for j in ran... | <filename>25/main.py<gh_stars>0
def global_alignment(seq1, seq2, score_matrix, penalty):
len1, len2 = len(seq1), len(seq2)
s = [[0] * (len2 + 1) for i in range(len1 + 1)]
backtrack = [[0] * (len2 + 1) for i in range(len1 + 1)]
for i in range(1, len1 + 1):
s[i][0] = - i * penalty
for j in ran... | none | 1 | 2.90685 | 3 | |
utils/visualize_tree.py | moyiming1/Retrosynthesis-pathway-ranking | 10 | 10766 | <gh_stars>1-10
import os, sys
project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_path)
import pickle
def construct_tree_for_visual(tree, node_info_key, depth=0):
tree_for_visual = {'smiles': 'http://askcos.mit.edu/draw/smiles/' + str(tree['smiles']).replace('#', '%2... | import os, sys
project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_path)
import pickle
def construct_tree_for_visual(tree, node_info_key, depth=0):
tree_for_visual = {'smiles': 'http://askcos.mit.edu/draw/smiles/' + str(tree['smiles']).replace('#', '%23'),
... | en | 0.525148 | # tree_for_visual['children'] = [] # if 'is_chemical' in tree.keys(): # new_tree['smiles'] = str(new_tree['smiles']) # print(len(tree['child'])) # print() # print(tree_info[i]) # print(max_children) #fff;\n') #fff;\n') #ccc;\n') | 2.675075 | 3 |
python-is-easy/assignments/snowman/main.py | eDyablo/pirple | 0 | 10767 | <filename>python-is-easy/assignments/snowman/main.py<gh_stars>0
'''
Homework assignment for the 'Python is easy' course by Pirple.
Written be <NAME>.
Snowman(Hangman) game.
'''
from os import (
name as os_name,
system as system_call,
)
from os.path import (
abspath,
dirname,
join as join_path,
)... | <filename>python-is-easy/assignments/snowman/main.py<gh_stars>0
'''
Homework assignment for the 'Python is easy' course by Pirple.
Written be <NAME>.
Snowman(Hangman) game.
'''
from os import (
name as os_name,
system as system_call,
)
from os.path import (
abspath,
dirname,
join as join_path,
)... | en | 0.940596 | Homework assignment for the 'Python is easy' course by Pirple. Written be <NAME>. Snowman(Hangman) game. Screen displays game output Input represents game input device Art is a game art which is set of frames that get loaded from a text file. Draws its current frame on a screen. Riddle holds secret word and gets solv... | 3.827163 | 4 |
src/GenericTsvReader.py | getzlab/ABSOLUTE | 0 | 10768 | <reponame>getzlab/ABSOLUTE
"""
Created on Jul 5, 2012
@author: lichtens
"""
import csv
import os
class GenericTsvReader(object):
"""
Read a TSV file.
This class wraps a DictReader, but handles comments, which are not handled gracefully in the python csv library.
The next() method assumes... | """
Created on Jul 5, 2012
@author: lichtens
"""
import csv
import os
class GenericTsvReader(object):
"""
Read a TSV file.
This class wraps a DictReader, but handles comments, which are not handled gracefully in the python csv library.
The next() method assumes user is interested in the ... | en | 0.892763 | Created on Jul 5, 2012 @author: lichtens Read a TSV file. This class wraps a DictReader, but handles comments, which are not handled gracefully in the python csv library. The next() method assumes user is interested in the content, not the comments. Get the comments using getComments or ... | 3.262261 | 3 |
examples/applications/plot_impact_imbalanced_classes.py | cdchushig/imbalanced-learn | 5,678 | 10769 | """
==========================================================
Fitting model on imbalanced datasets and how to fight bias
==========================================================
This example illustrates the problem induced by learning on datasets having
imbalanced classes. Subsequently, we compare different approac... | """
==========================================================
Fitting model on imbalanced datasets and how to fight bias
==========================================================
This example illustrates the problem induced by learning on datasets having
imbalanced classes. Subsequently, we compare different approac... | en | 0.831571 | ========================================================== Fitting model on imbalanced datasets and how to fight bias ========================================================== This example illustrates the problem induced by learning on datasets having imbalanced classes. Subsequently, we compare different approaches ... | 3.613719 | 4 |
python/fix-page-breaks.py | utcompling/GeoAnnotate | 9 | 10770 | <filename>python/fix-page-breaks.py
#!/usr/bin/python
import argparse
import re
parser = argparse.ArgumentParser(description='Fix page breaks in War of The Rebellion text')
parser.add_argument('files', nargs='*',
help='Files to process')
args = parser.parse_args()
for file in args.files:
outfile... | <filename>python/fix-page-breaks.py
#!/usr/bin/python
import argparse
import re
parser = argparse.ArgumentParser(description='Fix page breaks in War of The Rebellion text')
parser.add_argument('files', nargs='*',
help='Files to process')
args = parser.parse_args()
for file in args.files:
outfile... | en | 0.475347 | #!/usr/bin/python # Remove empty pages # Remove extraneous blank lines # Undo HTML entities # Do the following a second time to handle cases of # &amp;, which are common #@$|^\\/&~=>!?]|[abc] |[abc][A-Z])[^\n]*\n|\n)* *-------+\n+(?:[*+#@$|^\\/&~=>!?] *[A-Z][^\n]*\n|\n)*)$", pages[i], re.S) | 3.105685 | 3 |
2021/02/part2.py | FranciscoAT/advent-of-code | 0 | 10771 | <gh_stars>0
def main(file: str) -> None:
depth = 0
distance = 0
aim = 0
with open(f"{file}.in") as f:
for line in f.readlines():
line = line.rstrip().split(" ")
command = line[0]
unit = int(line[1])
if command == "forward":
distance... | def main(file: str) -> None:
depth = 0
distance = 0
aim = 0
with open(f"{file}.in") as f:
for line in f.readlines():
line = line.rstrip().split(" ")
command = line[0]
unit = int(line[1])
if command == "forward":
distance += unit
... | none | 1 | 3.549312 | 4 | |
tf_seal/python/tensor.py | karlhigley/tf-seal | 94 | 10772 | <reponame>karlhigley/tf-seal<filename>tf_seal/python/tensor.py
import numpy as np
import tensorflow as tf
import tf_seal.python.ops.seal_ops as ops
from tensorflow.python.keras.utils import tf_utils
from tensorflow.python.client import session as tf_session
from tensorflow.python.framework import ops as tf_ops
clas... | import numpy as np
import tensorflow as tf
import tf_seal.python.ops.seal_ops as ops
from tensorflow.python.keras.utils import tf_utils
from tensorflow.python.client import session as tf_session
from tensorflow.python.framework import ops as tf_ops
class Tensor(object):
def __init__(self, value, secret_key, publ... | en | 0.724403 | # return tf.string # def __sub__(self, other): # other = convert_to_tensor(other) # res = ops.big_sub(self._raw, other._raw) # return Tensor(res) # this allows tf_seal.Tensor to be passed directly to tf.Session.run, # unwrapping and converting the result as needed # TODO(Morten) # this allows implicit con... | 2.538666 | 3 |
program/admin.py | Dumbaz/autoradio-pv | 0 | 10773 | from django.core.exceptions import ObjectDoesNotExist
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import render
from django.conf import settings
from .models import Language, Type, MusicFocus, Category, Topic, RTRCategory, Host, Note, RRule, Schedule, ... | from django.core.exceptions import ObjectDoesNotExist
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import render
from django.conf import settings
from .models import Language, Type, MusicFocus, Category, Topic, RTRCategory, Host, Note, RRule, Schedule, ... | en | 0.86693 | # active/inactive Schedules # active/inactive Shows # active/inactive Hosts # Common users only see hosts of shows they own # Commons users only see notes of shows they own # Adding/Editing a note: load timeslots of the user's shows into the dropdown # TODO: Don't show any timeslot in the select by default. # Use... | 2.039994 | 2 |
test/logic/test_block_features.py | Sam-prog-sudo/Sam.github.io | 3 | 10774 | <gh_stars>1-10
import hashlib
import json
from time import time
import pytest
from app.chaine.blockchain import Blockchain
@pytest.fixture
def first_block():
return {
'index': 1,
'timestamp': time(),
'transactions': [],
'proof': 1989,
'previous_hash': 1,
}
def test_... | import hashlib
import json
from time import time
import pytest
from app.chaine.blockchain import Blockchain
@pytest.fixture
def first_block():
return {
'index': 1,
'timestamp': time(),
'transactions': [],
'proof': 1989,
'previous_hash': 1,
}
def test_initialization_... | none | 1 | 2.210034 | 2 | |
urls.py | cartologic/cartoview_graduated_styler | 0 | 10775 | <gh_stars>0
# from django.conf.urls import patterns, url, include
# from django.views.generic import TemplateView
# from . import views, APP_NAME
#
# urlpatterns = patterns('',
# url(r'^$', views.index, name='%s.index' % APP_NAME),
# )
from django.urls import path, re_path, include
from . import views, APP_NAME
fr... | # from django.conf.urls import patterns, url, include
# from django.views.generic import TemplateView
# from . import views, APP_NAME
#
# urlpatterns = patterns('',
# url(r'^$', views.index, name='%s.index' % APP_NAME),
# )
from django.urls import path, re_path, include
from . import views, APP_NAME
from .api impo... | en | 0.578693 | # from django.conf.urls import patterns, url, include # from django.views.generic import TemplateView # from . import views, APP_NAME # # urlpatterns = patterns('', # url(r'^$', views.index, name='%s.index' % APP_NAME), # ) | 1.956869 | 2 |
core/rest/wscdn.py | cybert79/Osmedeus | 1 | 10776 | import os
import glob
import json
from pathlib import Path
from flask_restful import Api, Resource, reqparse
from flask_jwt_extended import jwt_required
from flask import Flask, request, escape, make_response, send_from_directory
import utils
# incase you can't install ansi2html it's won't break the api
try:
from ... | import os
import glob
import json
from pathlib import Path
from flask_restful import Api, Resource, reqparse
from flask_jwt_extended import jwt_required
from flask import Flask, request, escape, make_response, send_from_directory
import utils
# incase you can't install ansi2html it's won't break the api
try:
from ... | en | 0.804155 | # incase you can't install ansi2html it's won't break the api render stdout content # loop though all options avalible # get real path # just replace the first one | 2.484005 | 2 |
custom_components/hahm/services.py | noxhirsch/custom_homematic | 0 | 10777 | """Module with hahomematic services."""
from __future__ import annotations
from datetime import datetime
import logging
from hahomematic.const import (
ATTR_ADDRESS,
ATTR_INTERFACE_ID,
ATTR_NAME,
ATTR_PARAMETER,
ATTR_VALUE,
HmPlatform,
)
from hahomematic.device import HmDevice
from hahomematic... | """Module with hahomematic services."""
from __future__ import annotations
from datetime import datetime
import logging
from hahomematic.const import (
ATTR_ADDRESS,
ATTR_INTERFACE_ID,
ATTR_NAME,
ATTR_PARAMETER,
ATTR_VALUE,
HmPlatform,
)
from hahomematic.device import HmDevice
from hahomematic... | en | 0.789944 | Module with hahomematic services. Create the hahomematic services. Call correct HomematicIP Cloud service. Unload HAHM services. Service to call setValue method for HomeMatic devices. Service to call setValue method for HomeMatic system variable. Service to call setValue method for HomeMatic devices. # Convert value in... | 1.98916 | 2 |
app/migrations/0001_initial.py | MariaAlice00/ifpi-tds-projeto-integrador | 0 | 10778 | # Generated by Django 3.2.3 on 2021-06-03 00:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Livro',
fields=[
('id', models.BigAutoField... | # Generated by Django 3.2.3 on 2021-06-03 00:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Livro',
fields=[
('id', models.BigAutoField... | en | 0.859339 | # Generated by Django 3.2.3 on 2021-06-03 00:35 | 1.761269 | 2 |
graalpython/com.oracle.graal.python.parser.antlr/postprocess.py | transposit/graalpython | 1 | 10779 | # Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
#
# Subject to the condition set forth below, permission is hereby granted to any
# person obtaining a copy of this softw... | # Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
#
# Subject to the condition set forth below, permission is hereby granted to any
# person obtaining a copy of this softw... | en | 0.812622 | # Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # The Universal Permissive License (UPL), Version 1.0 # # Subject to the condition set forth below, permission is hereby granted to any # person obtaining a copy of this softw... | 1.165558 | 1 |
scripts/ape_protocol_deploy.py | coordinape/coordinape-protocol | 22 | 10780 | <reponame>coordinape/coordinape-protocol
from brownie import accounts, Wei, chain, ApeToken, ApeVaultFactory, ApeDistributor, ApeRegistry, ApeRouter, FeeRegistry, MockRegistry, MockVaultFactory, MockToken, MockVault
def deploy_token():
funds = accounts.load('moist', '\0')
user = accounts.load('ape_deployer', '\0')
... | from brownie import accounts, Wei, chain, ApeToken, ApeVaultFactory, ApeDistributor, ApeRegistry, ApeRouter, FeeRegistry, MockRegistry, MockVaultFactory, MockToken, MockVault
def deploy_token():
funds = accounts.load('moist', '\0')
user = accounts.load('ape_deployer', '\0')
multi_sig = '0x15B513F658f7390D8720dCE32... | en | 0.531464 | # funds.transfer(to=user, amount='1 ether') # ape = ApeToken.deploy({'from':user}, publish_source=True) # ape.transferOwnership(multi_sig, {'from':user}) # 14 days # 14 days # setup_mockvaults(mock_yearn_vault_factories, user) # min_delay_call = mock_ape_reg.changeMinDelay.encode_input(lock_length) # mock_ape_reg.sched... | 1.975774 | 2 |
groups/views.py | MAKENTNU/web | 10 | 10781 | <filename>groups/views.py
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.urls import reverse_lazy
from django.views.generic import DetailView, ListView, UpdateView
from .models import Committee
class CommitteeList(ListView):
model = Committee
template_name = 'groups/committee_list... | <filename>groups/views.py
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.urls import reverse_lazy
from django.views.generic import DetailView, ListView, UpdateView
from .models import Committee
class CommitteeList(ListView):
model = Committee
template_name = 'groups/committee_list... | none | 1 | 2.001575 | 2 | |
src/programy/braintree.py | motazsaad/fit-bot-fb-clt | 0 | 10782 | <reponame>motazsaad/fit-bot-fb-clt<gh_stars>0
"""
Copyright (c) 2016-2019 <NAME> http://www.keithsterling.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... | """
Copyright (c) 2016-2019 <NAME> http://www.keithsterling.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 limitation
the rights to use, copy, modify, m... | en | 0.754276 | Copyright (c) 2016-2019 <NAME> http://www.keithsterling.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 limitation the rights to use, copy, modify, merge... | 1.567724 | 2 |
reana_commons/publisher.py | marcdiazsan/reana-commons | 0 | 10783 | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons module to manage AMQP connections on REANA."""
import json
import logging
fr... | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Commons module to manage AMQP connections on REANA."""
import json
import logging
fr... | en | 0.823638 | # -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2018 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. REANA-Commons module to manage AMQP connections on REANA. Base publisher to MQ. Initialise the ... | 2.417658 | 2 |
model/commit.py | uniaim-event-team/pullre-kun | 3 | 10784 | from sqlalchemy import (
BigInteger,
Column,
DateTime,
Text,
String,
Integer,
)
from sqlalchemy.sql.functions import current_timestamp
from model.base import BaseObject
class Commit(BaseObject):
__tablename__ = 'commits'
id = Column(BigInteger, primary_key=True, autoincrement=True)
... | from sqlalchemy import (
BigInteger,
Column,
DateTime,
Text,
String,
Integer,
)
from sqlalchemy.sql.functions import current_timestamp
from model.base import BaseObject
class Commit(BaseObject):
__tablename__ = 'commits'
id = Column(BigInteger, primary_key=True, autoincrement=True)
... | none | 1 | 2.465212 | 2 | |
drae/__init__.py | hso/drae.py | 0 | 10785 | <reponame>hso/drae.py
from drae import search
| from drae import search | none | 1 | 0.95013 | 1 | |
tests/components/template/test_select.py | JeffersonBledsoe/core | 5 | 10786 | """The tests for the Template select platform."""
import pytest
from homeassistant import setup
from homeassistant.components.input_select import (
ATTR_OPTION as INPUT_SELECT_ATTR_OPTION,
ATTR_OPTIONS as INPUT_SELECT_ATTR_OPTIONS,
DOMAIN as INPUT_SELECT_DOMAIN,
SERVICE_SELECT_OPTION as INPUT_SELECT_SE... | """The tests for the Template select platform."""
import pytest
from homeassistant import setup
from homeassistant.components.input_select import (
ATTR_OPTION as INPUT_SELECT_ATTR_OPTION,
ATTR_OPTIONS as INPUT_SELECT_ATTR_OPTIONS,
DOMAIN as INPUT_SELECT_DOMAIN,
SERVICE_SELECT_OPTION as INPUT_SELECT_SE... | en | 0.814746 | The tests for the Template select platform. # Represent for select's current_option Track calls to a mock service. Test: missing optional template is ok. Test: multiple select entities get created. Test: missing required fields will fail. Test templates with values from other entities. Test trigger based template selec... | 2.20898 | 2 |
corefacility/core/test/models/test_application_access.py | serik1987/corefacility | 0 | 10787 | import os
import random
import string
import base64
from django.utils import timezone
from django.contrib.auth.hashers import make_password, check_password
from django.test import TestCase
from parameterized import parameterized
from core.models import Module, EntryPoint, ExternalAuthorizationSession, User
AUTHORIZA... | import os
import random
import string
import base64
from django.utils import timezone
from django.contrib.auth.hashers import make_password, check_password
from django.test import TestCase
from parameterized import parameterized
from core.models import Module, EntryPoint, ExternalAuthorizationSession, User
AUTHORIZA... | none | 1 | 2.169687 | 2 | |
cmsfix/lib/macro.py | trmznt/cmsfix | 0 | 10788 | <filename>cmsfix/lib/macro.py
from rhombus.lib.utils import get_dbhandler
from rhombus.lib.tags import *
from cmsfix.models.node import Node
import re
# the pattern below is either
# ///123
# <<MacroName>>
# [[MacroName]]
pattern = re.compile('///(\d+)|///\{([\w-]+)\}|\<\;\<\;(.+)\>\;\>\;|\[\[(.+)\]\]')
# s... | <filename>cmsfix/lib/macro.py
from rhombus.lib.utils import get_dbhandler
from rhombus.lib.tags import *
from cmsfix.models.node import Node
import re
# the pattern below is either
# ///123
# <<MacroName>>
# [[MacroName]]
pattern = re.compile('///(\d+)|///\{([\w-]+)\}|\<\;\<\;(.+)\>\;\>\;|\[\[(.+)\]\]')
# s... | en | 0.4698 | # the pattern below is either # ///123 # <<MacroName>> # [[MacroName]] # syntax for Macro is: # [[MacroName|option1|option2|option3]] return a new buffer post edit the content, return a new modified content # convert to UUID ## -- MACRO -- ## ## all macro functions should return either html or literal objects ## Create... | 2.373102 | 2 |
xastropy/sdss/qso.py | bpholden/xastropy | 3 | 10789 | '''
#;+
#; NAME:
#; sdss.qso
#; Version 1.1
#;
#; PURPOSE:
#; Class for SDSS QSO
#; 2015 Written by JXP
#;-
#;------------------------------------------------------------------------------
'''
# Import libraries
import numpy as np
import os
from astropy.table import QTable, Column
from astropy.coordinates i... | '''
#;+
#; NAME:
#; sdss.qso
#; Version 1.1
#;
#; PURPOSE:
#; Class for SDSS QSO
#; 2015 Written by JXP
#;-
#;------------------------------------------------------------------------------
'''
# Import libraries
import numpy as np
import os
from astropy.table import QTable, Column
from astropy.coordinates i... | en | 0.479078 | #;+ #; NAME: #; sdss.qso #; Version 1.1 #; #; PURPOSE: #; Class for SDSS QSO #; 2015 Written by JXP #;- #;------------------------------------------------------------------------------ # Import libraries Class to handle a single SDSS Quasar Parameters: ---------- coord: SkyCoord, optional R... | 2.206141 | 2 |
ez_sten/__init__.py | deadlift1226/ez-sten | 0 | 10790 | <reponame>deadlift1226/ez-sten
name = "module"
from .module import func
| name = "module"
from .module import func | none | 1 | 1.280127 | 1 | |
wisdem/test/test_optimization_drivers/test_dakota_driver.py | johnjasa/WISDEM | 81 | 10791 | import unittest
import numpy as np
from openmdao.utils.assert_utils import assert_near_equal
from wisdem.optimization_drivers.dakota_driver import DakotaOptimizer
try:
import dakota
except ImportError:
dakota = None
@unittest.skipIf(dakota is None, "only run if Dakota is installed.")
class Te... | import unittest
import numpy as np
from openmdao.utils.assert_utils import assert_near_equal
from wisdem.optimization_drivers.dakota_driver import DakotaOptimizer
try:
import dakota
except ImportError:
dakota = None
@unittest.skipIf(dakota is None, "only run if Dakota is installed.")
class Te... | none | 1 | 2.315692 | 2 | |
lab4_runTFCurveFitting.py | pskdev/EveryBodyTensorFlow | 1 | 10792 | #-*- coding: utf-8 -*-
#! /usr/bin/env python
'''
#------------------------------------------------------------
filename: lab4_runTFCurveFitting.py
This is an example for linear regression in tensorflow
Which is a curve fitting example
written by <NAME> @ Aug 2017
#---------------------------------------------... | #-*- coding: utf-8 -*-
#! /usr/bin/env python
'''
#------------------------------------------------------------
filename: lab4_runTFCurveFitting.py
This is an example for linear regression in tensorflow
Which is a curve fitting example
written by <NAME> @ Aug 2017
#---------------------------------------------... | en | 0.514409 | #-*- coding: utf-8 -*- #! /usr/bin/env python #------------------------------------------------------------ filename: lab4_runTFCurveFitting.py This is an example for linear regression in tensorflow Which is a curve fitting example written by <NAME> @ Aug 2017 #-------------------------------------------------... | 3.116788 | 3 |
app/route/stats/route.py | LifeLaboratory/finopolis_backend | 0 | 10793 | <reponame>LifeLaboratory/finopolis_backend
# coding=utf-8
from app.route.stats.processor import *
from app.api.base.base_router import BaseRouter
from app.api.base import base_name as names
class Stats(BaseRouter):
def __init__(self):
super().__init__()
self.args = [names.face, names.post, names.... | # coding=utf-8
from app.route.stats.processor import *
from app.api.base.base_router import BaseRouter
from app.api.base import base_name as names
class Stats(BaseRouter):
def __init__(self):
super().__init__()
self.args = [names.face, names.post, names.socnet, names.likes, names.views, names.com... | en | 0.644078 | # coding=utf-8 | 2.294161 | 2 |
script/calculate_correct_percentage_kingdom.py | xie186/dragmap-meth | 4 | 10794 | <gh_stars>1-10
from Bio import TogoWS
import argparse
import sys
import os
def summary(options):
num_reads = 0
num_correct = 0
with open(options.input) as file_input:
for line in file_input:
line = line.rstrip()
ele = line.split("\t")
if "FAILED" in line:
... | from Bio import TogoWS
import argparse
import sys
import os
def summary(options):
num_reads = 0
num_correct = 0
with open(options.input) as file_input:
for line in file_input:
line = line.rstrip()
ele = line.split("\t")
if "FAILED" in line:
contin... | en | 0.220615 | #raise("Makeblastdb failed!") #raise("Makeblastdb failed!") ## description - Text to display before the argument help (default: none) | 3.273652 | 3 |
borax/patterns/singleton.py | kinegratii/borax | 51 | 10795 | <reponame>kinegratii/borax<filename>borax/patterns/singleton.py<gh_stars>10-100
# coding=utf8
class MetaSingleton(type):
def __init__(cls, *args):
type.__init__(cls, *args)
cls.instance = None
def __call__(cls, *args, **kwargs):
if not cls.instance:
cls.instance = type.__c... | # coding=utf8
class MetaSingleton(type):
def __init__(cls, *args):
type.__init__(cls, *args)
cls.instance = None
def __call__(cls, *args, **kwargs):
if not cls.instance:
cls.instance = type.__call__(cls, *args, **kwargs)
return cls.instance | ca | 0.404804 | # coding=utf8 | 2.486921 | 2 |
aiida/backends/general/migrations/utils.py | pranavmodx/aiida-core | 0 | 10796 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | en | 0.702268 | # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ... | 1.988377 | 2 |
src/models/__init__.py | DwaraknathT/sparsity | 0 | 10797 | <filename>src/models/__init__.py
__all__ = ["transformers", "vision"]
from .transformers import *
from .vision import *
| <filename>src/models/__init__.py
__all__ = ["transformers", "vision"]
from .transformers import *
from .vision import *
| none | 1 | 1.217687 | 1 | |
packages/pyright-internal/src/tests/samples/genericTypes12.py | sasano8/pyright | 4,391 | 10798 | # This sample tests the checker's ability to enforce
# type invariance for type arguments.
# pyright: strict
from typing import Dict, Union
foo: Dict[Union[int, str], str] = {}
bar: Dict[str, str] = {}
# This should generate an error because
# both type parameters for Dict are invariant,
# and str isn't assignable ... | # This sample tests the checker's ability to enforce
# type invariance for type arguments.
# pyright: strict
from typing import Dict, Union
foo: Dict[Union[int, str], str] = {}
bar: Dict[str, str] = {}
# This should generate an error because
# both type parameters for Dict are invariant,
# and str isn't assignable ... | en | 0.761926 | # This sample tests the checker's ability to enforce # type invariance for type arguments. # pyright: strict # This should generate an error because # both type parameters for Dict are invariant, # and str isn't assignable to Union[int, str]. | 2.642449 | 3 |
test.py | Naveenkhasyap/udacity-ml | 0 | 10799 | <reponame>Naveenkhasyap/udacity-ml
how_many_snakes = 1
snake_string = """
Welcome to Python3!
____
/ . .\\
\\ ---<
\\ /
__________/ /
-=:___________/
<3, Juno
"""
print(snake_string * how_many_snakes) | how_many_snakes = 1
snake_string = """
Welcome to Python3!
____
/ . .\\
\\ ---<
\\ /
__________/ /
-=:___________/
<3, Juno
"""
print(snake_string * how_many_snakes) | en | 0.18899 | Welcome to Python3! ____ / . .\\ \\ ---< \\ / __________/ / -=:___________/ <3, Juno | 3.307518 | 3 |