prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
import MySQLdb
# Create your models here.
class Comentario(models.Model):
"""Comentario"""
contenido = models.TextField(help_text='Escribe un comentario')
fecha_coment = models.DateField(aut... | __unicode__ |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | self.integration_widget.img_phases_btn.isChecked():
self.cake_view_widget.show_cake_phase(ind) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | """
PhaseInCakeController handles all the interaction between the phase controls and the plotted lines in the cake view.
"""
def __init__(self, integration_widget, dioptas_model):
"""
:param integration_widget: Reference to an IntegrationWidget
:param dioptas_model: reference to... |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | """
:param integration_widget: Reference to an IntegrationWidget
:param dioptas_model: reference to DioptasModel object
:type integration_widget: IntegrationWidget
:type dioptas_model: DioptasModel
"""
self.model = dioptas_model
self.phase_model = self.mo... |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | self.phase_model.phase_added.connect(self.add_phase_plot)
self.model.phase_model.phase_removed.connect(self.cake_view_widget.del_cake_phase)
self.phase_model.phase_changed.connect(self.update_phase_lines)
self.phase_model.phase_changed.connect(self.update_phase_color)
self.phase... |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | """
Obtains the positions and intensities for lines of a phase with an index ind within the cake view.
No clipping is used for the first call to add the CakePhasePlot to the ImgWidget. Subsequent calls are used with
clipping. Thus, only lines within the cake_tth are returned. The visibi... |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | cake_line_positions, cake_line_intensities = self.get_phase_position_and_intensities(-1, False)
self.cake_view_widget.add_cake_phase(cake_line_positions, cake_line_intensities,
self.phase_model.phase_colors[-1]) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | cake_line_positions, cake_line_intensities = self.get_phase_position_and_intensities(ind)
self.cake_view_widget.update_phase_intensities(ind, cake_line_positions, cake_line_intensities) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | self.cake_view_widget.set_cake_phase_color(ind, self.model.phase_model.phase_colors[ind]) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | if self.phase_model.phase_visible[ind] and self.integration_widget.img_mode == 'Cake' and \
self.integration_widget.img_phases_btn.isChecked():
self.cake_view_widget.show_cake_phase(ind)
else:
self.cake_view_widget.hide_cake_phase(ind) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | self.cake_view_widget.phases[ind].add_line() |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | self.cake_view_widget.phases[phase_ind].delete_line(reflection_ind) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | cake_tth = self.model.calibration_model.tth |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | cake_tth = self.model.cake_tth |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | cake_line_positions.append(pos_ind + 0.5)
cake_line_intensities.append(reflections_intensities[ind]) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | cake_line_positions.append(0)
cake_line_intensities.append(reflections_intensities[ind]) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | self.cake_view_widget.show_cake_phase(ind) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | self.cake_view_widget.hide_cake_phase(ind) |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | __init__ |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | connect |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | get_phase_position_and_intensities |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | add_phase_plot |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | update_phase_lines |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | update_phase_color |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | update_phase_visible |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | reflection_added |
<|file_name|>PhaseInCakeController.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 In... | reflection_deleted |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """ |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
A reflex agent chooses an action at each choice point by examining
its alternatives via a state evaluation function.
The code below is provided as a guide. You are welcome to change
it in any way you see fit, so long as you don't touch our method
headers.
"""
def getAct... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
You do not need to change this method, but you're welcome to.
getAction chooses among the best options according to the evaluation function.
Just like in the previous project, getAction takes a GameState and returns
some Directions.X for some X in the set {North, South, Wes... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Design a better evaluation function here.
The evaluation function takes in the current and proposed successor
GameStates (pacman.py) and returns a number, where higher numbers are better.
The code below extracts some useful information from the state, like the
remai... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
This default evaluation function just returns the score of the state.
The score is the same one displayed in the Pacman GUI.
This evaluation function is meant for use with adversarial search agents
(not reflex agents).
"""
return currentGameState.getScore() |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
This class provides some common elements to all of your
multi-agent searchers. Any methods defined here will be available
to the MinimaxPacmanAgent, AlphaBetaPacmanAgent & ExpectimaxPacmanAgent.
You *do not* need to make any changes here, but you can if you want to
add functional... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | self.index = 0 # Pacman is always agent index 0
self.evaluationFunction = util.lookup(evalFn, globals())
self.depth = int(depth) |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Your minimax agent (question 2)
"""
def getAction(self, gameState):
"""
Returns the minimax action from the current gameState using self.depth
and self.evaluationFunction.
Here are some method calls that might be useful when implementing minimax.
... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Returns the minimax action from the current gameState using self.depth
and self.evaluationFunction.
Here are some method calls that might be useful when implementing minimax.
gameState.getLegalActions(agentIndex):
Returns a list of legal actions for an a... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Your minimax agent with alpha-beta pruning (question 3)
"""
def getAction(self, gameState):
"""
Returns the minimax action using self.depth and self.evaluationFunction
"""
"*** YOUR CODE HERE ***"
util.raiseNotDefined() |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Returns the minimax action using self.depth and self.evaluationFunction
"""
"*** YOUR CODE HERE ***"
util.raiseNotDefined() |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Your expectimax agent (question 4)
"""
def getAction(self, gameState):
"""
Returns the expectimax action using self.depth and self.evaluationFunction
All ghosts should be modeled as choosing uniformly at random from their
legal moves.
"""
"**... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Returns the expectimax action using self.depth and self.evaluationFunction
All ghosts should be modeled as choosing uniformly at random from their
legal moves.
"""
"*** YOUR CODE HERE ***"
util.raiseNotDefined() |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Your extreme ghost-hunting, pellet-nabbing, food-gobbling, unstoppable
evaluation function (question 5).
DESCRIPTION: <write something here so we know what you did>
"""
"*** YOUR CODE HERE ***"
util.raiseNotDefined() |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Your agent for the mini-contest
"""
def getAction(self, gameState):
"""
Returns an action. You can use any method you want and search to any depth you want.
Just remember that the mini-contest is timed, so you have to trade off speed and computation.
Ghosts... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | """
Returns an action. You can use any method you want and search to any depth you want.
Just remember that the mini-contest is timed, so you have to trade off speed and computation.
Ghosts don't behave randomly anymore, but they aren't perfect either -- they'll usually
... |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | return -10 |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | return 3 |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | return 10 |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | getAction |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | evaluationFunction |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | scoreEvaluationFunction |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | __init__ |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | getAction |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | getAction |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | getAction |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | betterEvaluationFunction |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | getAction |
<|file_name|>shield.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#<|fim▁hole|>from .aws import BaseARN
service_name = "AWS Shield"
prefix = "shield"
class Action(BaseAction):
def __init__(self, action: str = None) -> None:
super().__init__(pr... | # See LICENSE file for full license.
from .aws import Action as BaseAction |
<|file_name|>shield.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Shield"
prefix = "shield"
class Action(BaseAction):
<|fim_midd... | def __init__(self, action: str = None) -> None:
super().__init__(prefix, action) |
<|file_name|>shield.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Shield"
prefix = "shield"
class Action(BaseAction):
def __init... | super().__init__(prefix, action) |
<|file_name|>shield.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Shield"
prefix = "shield"
class Action(BaseAction):
def __init... | def __init__(self, resource: str = "", region: str = "", account: str = "") -> None:
super().__init__(
service=prefix, resource=resource, region=region, account=account
) |
<|file_name|>shield.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Shield"
prefix = "shield"
class Action(BaseAction):
def __init... | super().__init__(
service=prefix, resource=resource, region=region, account=account
) |
<|file_name|>shield.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Shield"
prefix = "shield"
class Action(BaseAction):
def <|fim_... | __init__ |
<|file_name|>shield.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "AWS Shield"
prefix = "shield"
class Action(BaseAction):
def __init... | __init__ |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | dMembro = None
relevante = None
autores = None
titulo = None
ano = None
natureza = None # tipo de producao
chave = None
def __init__(self, idMembro, partesDoItem='', relevante=''):
self.idMembro = set([])
self.idMembro.add(idMembro)
if not partesDoItem=='':
# partesDoItem[0]: Numero (NAO USADO)
... |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | elf.idMembro.add(idMembro)
if not partesDoItem=='':
# partesDoItem[0]: Numero (NAO USADO)
# partesDoItem[1]: Descricao do livro (DADO BRUTO)
self.relevante = relevante
self.item = partesDoItem[1]
# Dividir o item na suas partes constituintes
partes = self.item.partition(" . ")
self.autores =... |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | bjeto.idMembro) and compararCadeias(self.titulo, objeto.titulo):
# Os IDs dos membros são agrupados.
# Essa parte é importante para a criação do GRAFO de colaborações
self.idMembro.update(objeto.idMembro)
if len(self.autores)<len(objeto.autores):
self.autores = objeto.autores
if len(self.titulo)... |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | itulo + '</b>. '
s+= str(self.ano) + '. ' if str(self.ano).isdigit() else '. '
s+= self.natureza if not self.natureza=='' else ''
s+= menuHTMLdeBuscaPB(self.titulo)
return s
# ----------------------------- |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | LIOGRAFICA] \n"
s += "+ID-MEMBRO : " + str(self.idMembro) + "\n"
s += "+RELEVANTE : " + str(self.relevante) + "\n"
s += "+AUTORES : " + self.autores.encode('utf8','replace') + "\n"
s += "+TITULO : " + self.titulo.encode('utf8','replace') + "\n"
s += "+ANO : " + str(self.ano) + "\n"
s ... |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | self.item = partesDoItem[1]
# Dividir o item na suas partes constituintes
partes = self.item.partition(" . ")
self.autores = partes[0].strip()
partes = partes[2]
aux = re.findall(u' \((.*?)\)\.$', partes)
if len(aux)>0:
self.natureza = aux[-1]
partes = partes.rpartition(" (")
parte... |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | partes = partes.rpartition(" (")
partes = partes[0]
else:
self.natureza |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | = re.findall(u' ( |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | ).rstrip(".").rstrip(",")
partes = partes.rpartition(" ")
partes = partes[0]
else:
self.ano = '' |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | ulo = partes. |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | utores = ''
self.titulo = ''
self.ano = ''
self.natureza = ''
def compararCom(self, obj |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | o)
if len(self.autores)<len(objeto.autores):
self.autores = objeto.autores
if len(self.titulo)<len(objeto.titulo):
self.titulo = objeto.titulo
if len(self.natureza)<len(objeto.natureza):
self.natureza = objeto.natureza
return self
else: # nao similares
return |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | f len(self.titulo)<len(objeto |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | len(self.natureza)<len(obje |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | return self
else: # nao simi |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | DeMembros): |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | rtesDoIt |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | if self.idM |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | elf. |
<|file_name|>outroTipoDeProducaoBibliografica.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# encoding: utf-8
# filename: outroTipoDeProducaoBibliografica.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um sof... | O DE PR |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# django-simple-help
# simple_help/admin.py<|fim▁hole|>
from __future__ import unicode_literals
from django.contrib import admin
try: # add modeltranslation
from modeltranslation.translator import translator
from modeltranslation.adm... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# django-simple-help
# simple_help/admin.py
from __future__ import unicode_literals
from django.contrib import admin
try: # add modeltranslation
from modeltranslation.translator import translator
from modeltranslation.admin import T... | """
Customize PageHelp model for admin area.
"""
list_display = ["page", "title", ]
search_fields = ["title", ]
list_filter = ["page", ]
form = PageHelpAdminForm |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# django-simple-help
# simple_help/admin.py
from __future__ import unicode_literals
from django.contrib import admin
try: # add modeltranslation
from modeltranslation.translator import translator
from modeltranslation.admin import T... | translator.register(PageHelp, PageHelpTranslationOptions) |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Verify if the received data was signed by the owner of the certificate. |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Class responsible for keeping the CA self-signed certificate,
as well as, its private key.
"""
def __init__(self, cert, priv_key, passphrase):
""" Create a Certification Authority Object.
Arguments:
cert: file system path of the CA's self-signed certificate.
... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Create a Certification Authority Object.
Arguments:
cert: file system path of the CA's self-signed certificate.
priv_key: file system path of the CA's private key (encrypted).
passphrase: Symmetric key for priv_key decryption.
"""
def getPassphra... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Callback for private key decrypting.
"""
return str(passphrase.encode('utf-8')) |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Create a certificate for a subject public key, signed by the CA.
Arguments:
subj_id: certificate subject identifier.
pub_key: public key of the subject.
expiration_time: certificate life time.
Returns:
Certificate in PEM Format.
"""
... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Decrypt the intended data with the entity private key.
Arguments:
data: data to be decrypted.
"""
return self.priv_key.private_decrypt(data.decode('base64'), RSA.pkcs1_padding) |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Encrypt the intended data with the public key contained in the certificate.
Arguments:
data: data to be encrypted.
certificate: subject certificate.
"""
cert = X509.load_cert_string(certificate.decode('hex'))
return cert.get_pubkey().get_rsa().public_... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Get the CA Public Key.
Returns:
CA Public Key in PEM Format.
"""
return self.cert.get_pubkey().get_rsa().as_pem().encode('hex') |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Sign a received String.
Arguments:
data: string to sign.
Returns:
signature of the received data.
"""
msgDigest = EVP.MessageDigest('sha1')
msgDigest.update(str(data))
self.signEVP.sign_init()
self.signEVP.sign_update(msgDiges... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Sign encrypted data.
Arguments:
cipherData: data encrypted (base64 format).
"""
msgDigest = EVP.MessageDigest('sha1')
msgDigest.update(cipherData.decode('base64'))
self.signEVP.sign_init()
self.signEVP.sign_update(msgDigest.digest())
retur... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Verify if a certificate of a subject was issued by this CA.
Arguments:
certificate: subject certificate.
Returns:
true if the certificate was issued by this CA. false otherwise.
"""
cert = X509.load_cert_string(certificate.decode('hex'))
# Da... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Verify if the self-signed CA certificate was not corrupted.
Returns:
true if the self signed certificate is valid, false otherwise.
"""
return self.cert.check_ca() and self.cert.verify(self.cert.get_pubkey()) |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Verify if the received data was signed by the owner of the certificate.
Arguments:
data: received data.
signature: digital signature of the data.
certificate: certificate of the data issuer.
Returns:
true if the data maintains its integrity, ... |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | """ Verify if the received data was signed by the owner of the certificate.
Arguments:
cipherData: data encrypted (base64 format).
signature: digital signature of the data.
certificate: certificate of the data issuer.
Returns:
true if the data ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.